refactor[ReactDevToolsBindingsModel]: dont send messages when execution context is destroyed #114
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Stacked on #113. See this commit.
What is happening currently:
Runtime
domain is going to sendRuntime.executionContextDestroyed
event first.bridge.shutdown()
in order to destroy the bridge, so that we unsubscribe all listeners and correctly perform clean-up logic.bridge.shutdown
is called, the Bridge will attempt to send last eventshutdown
to the Backend to signal that it is being destroyed and so that the other end (Backend) can also perform some cleanup logic.Runtime.evaluate
request, which will be executed only after the new Execution Context is created. This results in a state, when the first event that is being received by the RDT Backend after reload is theshutdown
event.Instead of this, we should not attempt to send any events once the Execution Context is destroyed. There might be some issues with this, like clearing up highlights, but I haven't observed them, and we can deal with them via other methods.
Test plan
Runtime.evaluate
requests are sent betweenRuntime.executionContextDestroyed
andRuntime.executionContextCreated
events.Upstreaming plan
devtools-frontend
repo. I've reviewed the contribution guide.