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

fix(react-native): Copy RN's internal logging for unhandled rejections #1419

Merged
merged 1 commit into from
Jun 7, 2021

Conversation

bengourley
Copy link
Contributor

Goal

Prevent duplicate log lines for promise rejection warnings in development (as observed in #1311 (comment)).

Design

The previous implementation copied logic from the promise module – however, in development, RN used a custom onUnhandled callback which logged out once, rather than once per stackframe. This solution copies the RN internal logic, instead of the promise library default.

@github-actions
Copy link

github-actions bot commented May 25, 2021

@bugsnag/browser bundle size diff

Minified Minfied + Gzipped
Before 41.14 kB 12.66 kB
After 41.14 kB 12.66 kB
± No change No change

code coverage diff

Ok File Lines Branches Functions Statements
🔴 /home/runner/work/bugsnag-js/bugsnag-js/packages/plugin-react-native-unhandled-rejection/rejection-handler.js 84.21%
(-15.79%)
62.5%
(-19.32%)
100%
(+0%)
86.36%
(-13.64%)

Total:

Lines Branches Functions Statements
82.32%(-0.05%) 71.67%(-0.12%) 83.42%(-0.02%) 81.36%(-0.04%)

Generated by 🚫 dangerJS against 4c948ca

@bengourley bengourley requested a review from lemnik May 27, 2021 10:52
@bengourley bengourley force-pushed the bengourley/rn-dev-console-warn-format branch from f90b3ce to 4c948ca Compare June 2, 2021 16:08
Copy link
Contributor

@lemnik lemnik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@bengourley bengourley merged commit 0ffffdf into next Jun 7, 2021
@bengourley bengourley deleted the bengourley/rn-dev-console-warn-format branch June 7, 2021 10:42
@bengourley bengourley mentioned this pull request Jun 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants