mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/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