From 9c75871a8152f03d73ec52fc49c3e65a91a78d1e Mon Sep 17 00:00:00 2001 From: Blake Friedman Date: Mon, 5 Dec 2022 06:26:09 -0800 Subject: [PATCH] Fix abnormal close JS exception Summary: D40660765 (https://github.com/facebook/react-native/commit/3982a2c6bd116a6dcc6ee6889e4a246b710b70a7) introduced extra logging for abnormal closes. The websocked 'close' event may not be called with the event argument. Changelog: [Internal] - Fix for undefined websocket close Reviewed By: jacdebug, cortinico Differential Revision: D41731339 fbshipit-source-id: 92b28dcc0d55d0e9e32b4f4321f325fb3471edcd --- Libraries/Utilities/HMRClient.js | 1 + 1 file changed, 1 insertion(+) diff --git a/Libraries/Utilities/HMRClient.js b/Libraries/Utilities/HMRClient.js index b37f5961d2e0b3..dd15332779143b 100644 --- a/Libraries/Utilities/HMRClient.js +++ b/Libraries/Utilities/HMRClient.js @@ -247,6 +247,7 @@ Error: ${e.message}`; // https://www.rfc-editor.org/rfc/rfc6455.html#section-7.4.1 // https://www.rfc-editor.org/rfc/rfc6455.html#section-7.1.5 const isNormalOrUnsetCloseReason = + closeEvent == null || closeEvent.code === 1000 || closeEvent.code === 1005 || closeEvent.code == null;