Conversation
Semver Impact of This PR⚪ None (no version bump detected) 📋 Changelog PreviewThis is how your changes will appear in the changelog.
🤖 This preview updates automatically when you update the PR. |
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: Fallback returning empty array can wipe exception frames
- Added a check in symbolicate() to return null when sentryFrames.length === 0, preventing the truthy empty array from triggering replaceExceptionFramesInException and wiping original stack traces.
Or push these changes by commenting:
@cursor push 052a53a070
Preview (052a53a070)
diff --git a/packages/core/src/js/integrations/debugsymbolicator.ts b/packages/core/src/js/integrations/debugsymbolicator.ts
--- a/packages/core/src/js/integrations/debugsymbolicator.ts
+++ b/packages/core/src/js/integrations/debugsymbolicator.ts
@@ -92,6 +92,9 @@
);
const sentryFrames = await convertReactNativeFramesToSentryFrames(stackWithoutInternalCallsites);
+ if (sentryFrames.length === 0) {
+ return null;
+ }
return await fetchSourceContext(sentryFrames);
} catch (error) {
if (error instanceof Error) {This Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.
antonis
left a comment
There was a problem hiding this comment.
Other than the bot feedback LGTM
Co-authored-by: Claude <noreply@anthropic.com>
Sentry Build Distribution
|
|
|
||
| import { debug } from '@sentry/core'; | ||
| import { debug, parseStackFrames } from '@sentry/core'; | ||
| import { defaultStackParser } from '@sentry/react'; |
There was a problem hiding this comment.
Bug: The fallback stack parser from @sentry/react may not support Hermes bytecode-offset stack traces from production React Native builds, causing symbolication to fail silently.
Severity: MEDIUM
Suggested Fix
Ensure the fallback parser can handle all common React Native stack trace formats, including Hermes bytecode offsets. This could involve using a more appropriate RN-specific parser or extending the existing defaultStackParser and adding test cases that explicitly cover production Hermes stack formats (e.g., p@1:132161).
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.
Location: packages/core/src/js/integrations/debugsymbolicatorutils.ts#L4
Potential issue: The new fallback logic uses `defaultStackParser` from `@sentry/react`,
a browser-oriented parser. This parser is not guaranteed to handle all React Native
stack trace formats, particularly the Hermes bytecode-offset format (e.g., `p@1:132161`)
common in production builds. While tests confirm it handles V8-style Hermes traces,
there is no coverage for the bytecode format. When the primary
`ReactNative.Devtools.parseErrorStack` is unavailable and an error with a bytecode stack
occurs, the fallback will likely fail to parse the frames. The current implementation
handles this by returning an empty array, which causes symbolication to be silently
skipped, leading to unsymbolicated stack traces in Sentry reports for production errors.
Did we get this right? 👍 / 👎 to inform future reviews.


📢 Type of change
📜 Description
Use Sentry React Native stack trace parser when
ReactNativeLibraries.Devtools?.parseErrorStackis not available.The change did no impact on stack trace grouping. Still, I opted to always prefer
ReactNativeLibraries.Devtools?.parseErrorStackto avoid any kind of break change.💡 Motivation and Context
In the near future,
ReactNativeLibraries.Devtools?.parseErrorStackwill no longer exist.💚 How did you test it?
Error with RN Parser https://sentry-sdks.sentry.io/issues/5005282269/events/a7874a2c8efb405caa1a81d0c0f3caab/?project=5428561
Error with Sentry Parser https://sentry-sdks.sentry.io/issues/5005282269/events/45fee3cad3cc43d3821a4121fa4ed80d/?project=5428561
📝 Checklist
sendDefaultPIIis enabled🔮 Next steps
Close #5943
I don't think this PR needs any changelog, since it gives no value to end users at the moment since they are not impacted by it.