Skip to content

fix(core): Keep Hermes InternalBytecode.js frames out of app - #7138

Merged
antonis merged 2 commits into
mainfrom
fix/hermes-internal-bytecode-in-app
Dec 1, 2026
Merged

antonis merged 2 commits into
mainfrom
fix/hermes-internal-bytecode-in-app

Conversation

@antonis

@antonis antonis commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

📢 Type of change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring

📜 Description

Hermes runtime bytecode frames (InternalBytecode.js) are now sent as app:///node_modules/hermes/InternalBytecode.js instead of app:///InternalBytecode.js.

#6848 already marks these frames in_app: false, but sentry.io does not keep that value. During JavaScript processing, the server recomputes in_app from the path (is_in_app() in src/sentry/lang/javascript/processing.py): any app: path outside node_modules/ is in-app. With the node_modules segment, the frames are out of app on the server:

  • is_in_app() returns false.
  • The built-in path:**/node_modules/** -app grouping rule matches, also on the older grouping config.
  • should_skip_missing_source_error() would also skip a "missing source" processing error for this path (not observed on the test events below, which have no release or debug IDs).

The client-side in_app: false stays, for beforeSend and other client-side consumers.

The path is synthetic: there is no hermes package in node_modules. It only affects how the frame is labeled and classified.

💡 Motivation and Context

Fixes #7130. Async errors carry Hermes promise helpers (tryCallOne, step, anonymous), and these were in-app on sentry.io. Errors created in a library, which have no in-app frame of their own, were grouped on the Hermes frames. Since #6848 gave these frames the same filename on iOS and Android, the catch-all issues of both platforms could merge.

The reporter runs the same path in production and sees the frames come back out of app.

Grouping impact: the Hermes frames no longer contribute to the in-app grouping hash, so issues whose grouping included them get a new hash after the upgrade, and new issues open. This is the intended effect, and the CHANGELOG says so. On sentry.io, similarity grouping may keep many affected issues together; the hash change is still one-time.

Alternative considered: a built-in server rule (family:javascript stack.abs_path:**/InternalBytecode.js -app) would also cover older SDK versions. But it would only reach projects on the latest grouping config (the older rules file is frozen), would not remove the missing-source error, and would regroup every RN Hermes project at once, without an SDK upgrade or changelog entry.

💚 How did you test it?

  • Updated the RewriteFrames tests to expect the new path. The existing cases cover iOS/Android, Expo/non-Expo, and the bare, slash-prefixed and absolute Hermes filenames.
  • yarn lint, yarn circularDepCheck and a clean build:sdk pass locally.
  • Checked the server behavior against the getsentry/sentry source (is_in_app(), should_skip_missing_source_error(), the default grouping rules). I also ran Sentry's grouping rule engine (sentry-ophio 1.3.1, the version Sentry pins) on the frames from the issue.
  • Sent the event from InternalBytecode.js frames are still in-app after #6848: the server recomputes in_app for JavaScript frames from their path #7130 twice to sentry.io (grouping config newstyle:2026-01-20), with only the Hermes frame's path different:
    • Old path: event. tryCallOne is In App and part of the in-app grouping hash (ab270b7c…).
    • New path: event. tryCallOne is a system frame and drops out of the in-app hash (c3f1f491…). It only counts in the all-frames hash.
    • Both events ended up in the same issue even though their hashes differ, most likely because of Seer's similarity grouping.

📝 Checklist

  • I added tests to verify changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • All tests passing.
  • Public API changes reviewed by another Mobile SDK team member or implemented according to the develop docs spec.
  • No breaking changes.

🔮 Next steps

🤖 Generated with Claude Code

antonis and others added 2 commits November 30, 2026 10:43
sentry.io recomputes in_app for app:/// JavaScript frames from their
path and ignores the client value, so the in_app: false set in #6848 had
no effect and Hermes promise helpers (tryCallOne, step) kept driving
grouping. Send them under app:///node_modules/hermes/ so the server
treats them as third-party.

Fixes #7130

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

Semver Impact of This PR

⚪ None (no version bump detected)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


  • fix(core): Keep Hermes InternalBytecode.js frames out of app by antonis and claude in #7138
  • chore(deps): bump getsentry/github-workflows/danger from bce11fe6eaa86dbb9d360ab45a96e659828877f0 to edc87d6f133ac6204e22dee5123167a5eff3ed79 by dependabot in #7137
  • chore(deps): bump ruby/setup-ruby from 1.342.0 to 1.345.0 by dependabot in #7136
  • chore(deps): bump getsentry/craft from 3.13.0 to 3.14.1 by dependabot in #7135
  • chore(deps): bump getsentry/craft/.github/workflows/changelog-preview.yml from 3.13.0 to 3.14.1 by dependabot in #7134
  • chore(deps): bump the codeql-action group with 3 updates by dependabot in #7133
  • chore(deps): update Sentry Android Gradle Plugin to v6.28.0 by github-actions in #7129
  • feat(tracing): Report long tasks as ui.long-task spans in transactions by alwx in #7110
  • chore(deps): update Maestro to v2.13.0 by github-actions in #7126
  • chore(tooling): Make the verify-pr gate stop at the first no by antonis and claude with sentry-junior in #7125
  • chore(tooling): Add review checks and a gate-only mode to verify-pr by antonis and claude in #7121
  • chore(tooling): Fold the open-PR run findings into verify-pr by antonis and claude in #7115

🤖 This preview updates automatically when you update the PR.

@sentry

sentry Bot commented Nov 30, 2026

Copy link
Copy Markdown

📲 Install Builds

Android

🔗 App Name App ID Version Configuration
Sentry RN io.sentry.reactnative.sample 8.37.0 (117) Release

⚙️ sentry-react-native Build Distribution Settings

@antonis
antonis marked this pull request as ready for review November 30, 2026 12:38
sentry-junior Bot added a commit that referenced this pull request Nov 30, 2026
Co-Authored-By: Antonis Lilis <antonis.lilis@sentry.io>
@antonis

antonis commented Nov 30, 2026

Copy link
Copy Markdown
Contributor Author

@sentry-junior verify

@sentry-junior

sentry-junior Bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Experimental end-to-end verification by Junior, run on an Android emulator in CI. A maintainer decides what it means.

fix(core): Keep Hermes InternalBytecode.js frames out of app: Verified on Android

Claim (from #7130): sentry.io recomputes in_app for app:/// JavaScript frames from the path, so Hermes InternalBytecode.js frames stayed in-app despite the client's in_app: false. The same captured async error showed the Hermes frames (anonymous, tryCallOne) in-app on sentry.io without the PR and out of app with it. This repeats run 46455023608 on the same head with the same result.

Side Run id Event Hermes frames (anonymous, tryCallOne)
Without the PR gh46461886312-without 75a9e84a0b9d453ba71c4845c944b594 app:///InternalBytecode.js, in_app true
With the PR gh46461886312-with a77157c241ab45888c83bd6a3cf24cb9 app:///node_modules/hermes/InternalBytecode.js, in_app false

The event links need access to the sentry-sdks org.

  • Same on both: platform javascript, exception type Error, the other four frames (_next, asyncGeneratorStep, next in native, ?anon_0_) with the same filename and in_app, and the verify.pr tag (7138). One difference not in the plan, again: processing errors are 2× js_no_source without the PR and 1× with it. That fits the PR's note that should_skip_missing_source_error() skips the missing-source error for node_modules paths, but the fetch keeps no error names, so which frame each error was for isn't confirmed.
  • Built from: 92629a3 (PR head) with packages/core/src/js/integrations/rewriteframes.ts reversed against merge base e0775ba; bundles differ, native code identical (same dex).
  • Sample change: added "Capture Async Error" on verify/pr-7138 only (throws an Error after an await and captures it; no existing button did).
  • Flow: pr-7138-async-error.yml on verify/pr-7138
  • Not covered: iOS (affected, not run), the Old Architecture, debug builds, Expo, other React Native versions (sample: 0.88.1, Hermes), the effect on grouping.
  • Problems: none. One event per side, Maestro exit 0 on both, no runs started by the branch push.

Asked by antonis. Run: https://github.com/getsentry/sentry-react-native/actions/runs/46461886312

@antonis

antonis commented Nov 30, 2026

Copy link
Copy Markdown
Contributor Author

@sentry-junior gate

@antonis

antonis commented Nov 30, 2026

Copy link
Copy Markdown
Contributor Author

@sentry-junior verify

@antonis
antonis merged commit 1fe932c into main Dec 1, 2026
129 of 135 checks passed
@antonis
antonis deleted the fix/hermes-internal-bytecode-in-app branch December 1, 2026 07:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-merge Triggers the full CI test suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

InternalBytecode.js frames are still in-app after #6848: the server recomputes in_app for JavaScript frames from their path

2 participants