Skip to content

Commit

Permalink
Fix abnormal close JS exception
Browse files Browse the repository at this point in the history
Summary:
D40660765 (facebook@3982a2c) 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
  • Loading branch information
blakef authored and OlimpiaZurek committed May 22, 2023
1 parent 21c19d0 commit af04744
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions Libraries/Utilities/HMRClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit af04744

Please sign in to comment.