Inspector proxy: catch and report errors in device message handling#43697
Closed
robhogan wants to merge 2 commits into
Closed
Inspector proxy: catch and report errors in device message handling#43697robhogan wants to merge 2 commits into
robhogan wants to merge 2 commits into
Conversation
Contributor
|
This pull request was exported from Phabricator. Differential Revision: D55482735 |
4c537be to
ed4cec6
Compare
Contributor
|
This pull request was exported from Phabricator. Differential Revision: D55482735 |
…book#43686) Summary: Under Node 20, the use of `new Buffer(string)` is deprecated and logs a warning. This replaces it with the recommended `Buffer.from(string)`. Changelog: [General][Fixed] FIx "Buffer() is deprecated" warning from debugger proxy. Reviewed By: huntie Differential Revision: D55472025
…acebook#43697) Summary: Currently, messages from a device are handled by async handlers added to a promise chain. If a handler rejects, the end of the chain becomes a rejected promise, picked up only asynchronously by Metro's global `unhandledRejection` handler. This triggers a warning from Node.js, and worse, prevents any `then()` callback chained by subsequent messages from being invoked at all. Handlers *should* attempt to gracefully deal with errors (as we do with source map fetching errors, for example), but this diff adds a catch-all fallback for anything we might've missed (in this case, a frontend socket disconnecting while we're busy fetching a source map). Errors are caught and logged to EventReporter. **To follow**: Gracefully handle socket disconnections while an async handler is working or queued. Changelog: [General][Fixed] Inspector proxy: prevent errors proxying a device message from blocking the handler queue or spamming logs. Differential Revision: D55482735
ed4cec6 to
b46bd6c
Compare
Contributor
|
This pull request was exported from Phabricator. Differential Revision: D55482735 |
Contributor
|
This pull request has been merged in e05319c. |
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, messages from a device are handled by async handlers added to a promise chain.
If a handler rejects, the end of the chain becomes a rejected promise, picked up only asynchronously by Metro's global
unhandledRejectionhandler.This triggers a warning from Node.js, and worse, prevents any
then()callback chained by subsequent messages from being invoked at all.Handlers should attempt to gracefully deal with errors (as we do with source map fetching errors, for example), but this diff adds a catch-all fallback for anything we might've missed (in this case, a frontend socket disconnecting while we're busy fetching a source map). Errors are caught and logged to EventReporter.
To follow: Gracefully handle socket disconnections while an async handler is working or queued.
Changelog:
[General][Fixed] Inspector proxy: prevent errors proxying a device message from blocking the handler queue or spamming logs.
Differential Revision: D55482735