Skip to content

Commit

Permalink
Page reloads through execution context
Browse files Browse the repository at this point in the history
Summary:
This ressurects D14994945 and fixes the following extra issues:
1. Source map not being accounted for after reloads
2. Breakpoints being resent before Hermes is ready for them
3. Connection being dropped when reloading at inopportune times

This hopefully fixes the issue of having to close and re-open the debugger if
it's attached when reloading.

Reviewed By: sahrens

Differential Revision: D17100911

fbshipit-source-id: df988e7bb532170f5add47b9e49cd7c8ddf67b43
  • Loading branch information
willholen authored and facebook-github-bot committed Sep 5, 2019
1 parent 0a5c43f commit fa6add7
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,9 @@ private void handleWrappedEvent(JSONObject payload) throws JSONException {
String wrappedEvent = payload.getString("wrappedEvent");
Inspector.LocalConnection inspectorConnection = mInspectorConnections.get(pageId);
if (inspectorConnection == null) {
throw new IllegalStateException("Not connected: " + pageId);
// This tends to happen during reloads, so don't panic.
FLog.w(TAG, "PageID " + pageId + " is disconnected. Dropping event: " + wrappedEvent);
return;
}
inspectorConnection.sendMessage(wrappedEvent);
}
Expand Down

0 comments on commit fa6add7

Please sign in to comment.