Inspector proxy: preserve ordering of messages from device#43639
Closed
robhogan wants to merge 1 commit into
Closed
Inspector proxy: preserve ordering of messages from device#43639robhogan wants to merge 1 commit into
robhogan wants to merge 1 commit into
Conversation
Contributor
|
This pull request was exported from Phabricator. Differential Revision: D55200617 |
…43639) Summary: Currently, the `react-native/dev-middleware` inspector proxy intercepts `Debugger.scriptParsed` notifications from the target and replaces `sourceMapURL` with a data uri, via an async fetch from Metro. During this async fetch, other notifications from the debugger may pass through the proxy, which results in the frontend receiving them before `Debugger.scriptParsed`. This reordering causes problems in breakpoint resolution and pausing, because `Debugger.breakpointResolved` and `Debugger.paused` events may reference `scriptId`s unknown to the frontend while the corresponding `Debugger.scriptParsed` is delayed. In particular, breakpoint UI state and backend state can fall out of sync, and breakpoints hit may open to the incorrect source location. This diff modifies the proxy to use a simple per-target promise queue to ensure messages are handled in the order they were received from the target. Changelog: [General][Fixed] Fix breakpoints opening to incorrect location or disappearing from debugger frontend UI. Differential Revision: D55200617
168ae90 to
82b945b
Compare
Contributor
|
This pull request was exported from Phabricator. Differential Revision: D55200617 |
Contributor
|
This pull request has been merged in ac714b1. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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:
Currently, the
react-native/dev-middlewareinspector proxy interceptsDebugger.scriptParsednotifications from the target and replacessourceMapURLwith a data uri, via an async fetch from Metro. During this async fetch, other notifications from the debugger may pass through the proxy, which results in the frontend receiving them beforeDebugger.scriptParsed.This reordering causes problems in breakpoint resolution and pausing, because
Debugger.breakpointResolvedandDebugger.pausedevents may referencescriptIds unknown to the frontend while the correspondingDebugger.scriptParsedis delayed.In particular, breakpoint UI state and backend state can fall out of sync, and breakpoints hit may open to the incorrect source location.
This diff modifies the proxy to use a simple per-target promise queue to ensure messages are handled in the order they were received from the target.
Changelog:
[General][Fixed] Fix breakpoints opening to incorrect location or disappearing from debugger frontend UI.
Differential Revision: D55200617