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

[PLAT-5000] React Native promise rejection stack trace processing #812

Merged

Conversation

nickdowell
Copy link
Contributor

Goal

This change allows BugsnagReactNative to convert the native promise rejection stack trace provided by React Native into an array of BugsnagStackframe objects, so that it can be captured as a BugsnagError.

Design

See ROAD-801 for details of the design and specification.

Changeset

[BugsnagStackframe stackframesWithCallStackSymbols:] was added, which will be invoked by BugsnagReactNative.

Testing

Unit test cases have been added to verify the processing of passed in call stacks into BugsnagStackframe objects.

End-to-end automated tests will be covered in bugsnag-js

Bugsnag/Payload/BugsnagStackframe.m Show resolved Hide resolved
Tests/BugsnagStackframeTest.m Outdated Show resolved Hide resolved
@nickdowell nickdowell merged commit 913cd10 into next Sep 21, 2020
@nickdowell nickdowell deleted the 5000-react-native-promise-rejection-stacktrace-processing branch September 21, 2020 16:00
+ (NSArray<BugsnagStackframe *> *)stackframesWithCallStackSymbols:(NSArray<NSString *> *)callStackSymbols {
NSString *pattern = (@"^(\\d+)" // Capture the leading frame number
@" +" // Skip whitespace
@"(\\S+)" // Image name
Copy link

@JoeLago JoeLago Mar 16, 2021

Choose a reason for hiding this comment

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

Hi, sorry if it's inappropriate to dig up an old pull request like this. I was trying to use this function to rebuild a stacktrace with some callStackSymbols I cached for a handled error and I believe I'm losing my apps frames because there is a space in our apps display name. For Example:

"0   ReactNative Test                     0x000000010fda7f1b RCTJSErrorFromCodeMessageAndNSError + 79"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for reporting this - we are working on a fix: #1036

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.

3 participants