Skip to content

fix(android): Settle initNativeReactNavigationNewFrameTracking promise - #6823

Open
antonis wants to merge 4 commits into
mainfrom
antonis/stale-turbo-modules
Open

antonis wants to merge 4 commits into
mainfrom
antonis/stale-turbo-modules

Conversation

@antonis

@antonis antonis commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

📢 Type of change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring

📜 Description

The fix settles the promise, mirroring iOS:

public void initNativeReactNavigationNewFrameTracking(Promise promise) {
  //...
  promise.resolve(null);
}

💡 Motivation and Context

Fixes #6821

💚 How did you test it?

  • Added tests
  • Manual run

📝 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

The Android implementation accepted the Promise but never settled it, so
the JS TurboModule tracker's startup frame never popped. Every subsequent
native crash was then tagged with the stale
`turbo_module.method: initNativeReactNavigationNewFrameTracking` instead
of the call in flight. Resolve the promise, mirroring iOS.

Fixes #6821

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

github-actions Bot commented Oct 2, 2026 •

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(android): Settle initNativeReactNavigationNewFrameTracking promise by antonis in #6823
  • fix(ios): Prevent crash when initialized with an invalid DSN by antonis in #6825
  • chore(core): Resolve non-actionable TODOs by antonis in #6826
  • chore(core): resolve stale TODO comments by antonis in #6819
  • fix(profiling): Populate Hermes runtime version on JS profiles by antonis in #6817

🤖 This preview updates automatically when you update the PR.

Comment thread CHANGELOG.md Outdated
@antonis antonis added the ready-to-merge Triggers the full CI test suite label Oct 2, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 70d692c. Configure here.

@github-actions

github-actions Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Android (legacy) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 440.88 ms 445.82 ms 4.94 ms
Size 50.56 MiB 56.59 MiB 6.03 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
0b5a379+dirty 472.78 ms 533.16 ms 60.38 ms
bf168a4+dirty 418.21 ms 489.74 ms 71.53 ms
1a2e7e0+dirty 416.61 ms 445.46 ms 28.85 ms
a2585ce+dirty 426.36 ms 483.26 ms 56.90 ms
4e0b819+dirty 420.56 ms 470.08 ms 49.52 ms
9c84b9a+dirty 520.74 ms 539.38 ms 18.64 ms
2c735cc+dirty 414.09 ms 438.47 ms 24.38 ms
5c1e987+dirty 423.52 ms 471.64 ms 48.12 ms
04207c4+dirty 459.19 ms 518.54 ms 59.35 ms
68ae91b+dirty 416.44 ms 477.56 ms 61.12 ms

App size

Revision Plain With Sentry Diff
0b5a379+dirty 48.30 MiB 53.58 MiB 5.28 MiB
bf168a4+dirty 49.74 MiB 55.09 MiB 5.35 MiB
1a2e7e0+dirty 49.74 MiB 54.82 MiB 5.07 MiB
a2585ce+dirty 49.74 MiB 55.36 MiB 5.61 MiB
4e0b819+dirty 49.74 MiB 54.81 MiB 5.07 MiB
9c84b9a+dirty 49.74 MiB 55.36 MiB 5.62 MiB
2c735cc+dirty 43.75 MiB 48.08 MiB 4.33 MiB
5c1e987+dirty 43.75 MiB 48.08 MiB 4.33 MiB
04207c4+dirty 43.75 MiB 48.12 MiB 4.37 MiB
68ae91b+dirty 49.74 MiB 54.79 MiB 5.05 MiB

Previous results on branch: antonis/stale-turbo-modules

Startup times

Revision Plain With Sentry Diff
b7f0427+dirty 477.16 ms 509.28 ms 32.12 ms

App size

Revision Plain With Sentry Diff
b7f0427+dirty 50.56 MiB 56.59 MiB 6.03 MiB

@sentry

sentry Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

📲 Install Builds

Android

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

⚙️ sentry-react-native Build Distribution Settings

@github-actions

github-actions Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Android (new) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 423.74 ms 493.65 ms 69.91 ms
Size 50.56 MiB 56.59 MiB 6.03 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
bf168a4+dirty 430.60 ms 459.31 ms 28.71 ms
0bd8916+dirty 400.15 ms 442.72 ms 42.57 ms
a2585ce+dirty 414.04 ms 456.83 ms 42.79 ms
9c84b9a+dirty 429.26 ms 448.90 ms 19.64 ms
bc0d8cf+dirty 407.66 ms 461.35 ms 53.69 ms
a736b76+dirty 405.78 ms 458.74 ms 52.96 ms
1122a96+dirty 510.16 ms 542.00 ms 31.84 ms
267d3ed+dirty 424.69 ms 483.70 ms 59.01 ms
6177334+dirty 404.80 ms 456.74 ms 51.94 ms
7887847+dirty 420.47 ms 460.55 ms 40.08 ms

App size

Revision Plain With Sentry Diff
bf168a4+dirty 49.74 MiB 55.09 MiB 5.35 MiB
0bd8916+dirty 48.30 MiB 53.57 MiB 5.26 MiB
a2585ce+dirty 49.74 MiB 55.36 MiB 5.61 MiB
9c84b9a+dirty 49.74 MiB 55.36 MiB 5.62 MiB
bc0d8cf+dirty 48.30 MiB 53.48 MiB 5.18 MiB
a736b76+dirty 48.30 MiB 53.48 MiB 5.18 MiB
1122a96+dirty 48.30 MiB 53.54 MiB 5.24 MiB
267d3ed+dirty 48.30 MiB 53.58 MiB 5.28 MiB
6177334+dirty 48.30 MiB 53.54 MiB 5.23 MiB
7887847+dirty 49.74 MiB 54.81 MiB 5.07 MiB

Previous results on branch: antonis/stale-turbo-modules

Startup times

Revision Plain With Sentry Diff
b7f0427+dirty 433.98 ms 466.44 ms 32.46 ms

App size

Revision Plain With Sentry Diff
b7f0427+dirty 50.56 MiB 56.59 MiB 6.03 MiB

@antonis
antonis marked this pull request as ready for review October 2, 2026 09:36
@antonis antonis removed the ready-to-merge Triggers the full CI test suite label Oct 2, 2026
@antonis
antonis force-pushed the antonis/stale-turbo-modules branch from b3848b2 to d96d4d3 Compare October 2, 2026 11:49
A brownfield / hybrid host can run a non-FragmentActivity, where
`(FragmentActivity) getCurrentActivity()` throws ClassCastException. That
would skip `promise.resolve(null)` and re-leak the TurboModule tracker
frame — the same bug this PR fixes. Guard the cast with instanceof so a
non-FragmentActivity skips fragment tracking gracefully instead.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@antonis
antonis force-pushed the antonis/stale-turbo-modules branch from d96d4d3 to dd4851f Compare October 2, 2026 11:51
@antonis antonis added the ready-to-merge Triggers the full CI test suite label Oct 2, 2026

@lucas-zimerman lucas-zimerman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM!

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.

Android: turbo_module.* crash tags permanently pinned to RNSentry.initNativeReactNavigationNewFrameTracking (promise never settles)

2 participants