-
Notifications
You must be signed in to change notification settings - Fork 24.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Inspector proxy: catch and report errors in device message handling (#…
…43697) Summary: Pull Request resolved: #43697 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. Reviewed By: EdmondChuiHW Differential Revision: D55482735 fbshipit-source-id: bb726218495e105f9cb4f723a1d110c9815abdef
- Loading branch information
1 parent
04bf8cf
commit e05319c
Showing
3 changed files
with
46 additions
and
4 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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