Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

React Native Error Handler doesn't wait for events to be flushed #3026

Closed
krystofwoldrich opened this issue May 2, 2023 · 0 comments
Closed

Comments

@krystofwoldrich
Copy link
Member

krystofwoldrich commented May 2, 2023

Description

Then unhandled JS error is thrown the global error handler creates an event from it.

This handler should wait until the current events in the transport queue are flushed, but because the handle is handled by RN as a synchronous function it doesn't wait.

Because it doesn't wait for events to be flushed, events with screenshots, view hierarchy, or larger attachments might not make it to be saved by the native SDK to be sent on the next start.

It doesn't seem to be an issue at the moment, but I wanted to make a note about it.

We could use something similar to https://github.com/a7ul/react-native-exception-handler to postpone the crash on native layers.

if (!__DEV__) {
void client.flush(options.shutdownTimeout || 2000).then(() => {
defaultHandler(error, isFatal);
});

@krystofwoldrich krystofwoldrich closed this as not planned Won't fix, can't repro, duplicate, stale May 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

1 participant