Skip to content

Commit 7fce997

Browse files
deadwater88facebook-github-bot
authored andcommitted
Stops endless logging by packager client for debug builds that use static bundles. (#24050)
Summary: For the use-case where iOSdebug builds prefer to use static bundles over bundles served dynamically by metro. There's currently a bug caused by the packager client repeatedly attempting to connect to metro. This leads to endless log statements in xcode as well as other side effects: #21030. Fix is based off of #21030 which fixes the behavior for the inspector. Stops endless logging by packager client for debug builds that use static bundles. [CATEGORY] [TYPE] - Message Pull Request resolved: #24050 Differential Revision: D14541574 Pulled By: cpojer fbshipit-source-id: 09c2c82eb2d4aeb0e7ba322fd81b0dd7bf9e683c
1 parent e3f9d7e commit 7fce997

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Diff for: Libraries/WebSocket/RCTReconnectingWebSocket.m

+3-1
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,9 @@ - (void)webSocketDidOpen:(RCTSRWebSocket *)webSocket
163163
- (void)webSocket:(RCTSRWebSocket *)webSocket didFailWithError:(NSError *)error
164164
{
165165
[_delegate reconnectingWebSocketDidClose:self];
166-
[self reconnect];
166+
if ([error code] != ECONNREFUSED) {
167+
[self reconnect];
168+
}
167169
}
168170

169171
- (void)webSocket:(RCTSRWebSocket *)webSocket didCloseWithCode:(NSInteger)code reason:(NSString *)reason wasClean:(BOOL)wasClean

0 commit comments

Comments
 (0)