Page reloads through execution context

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
This commit is contained in:
Will Holen
2019-09-05 16:30:04 -07:00
committed by Facebook Github Bot
parent 0a5c43fcc3
commit fa6add7d4b
@@ -138,7 +138,9 @@ public class InspectorPackagerConnection {
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);
}