Skip to content

docs(core): Correct enableTurboModuleTracking docs and document TurboModule plumbing - #6582

Merged
lucas-zimerman merged 1 commit into
mainfrom
alwx/docs/6168
Aug 10, 2026
Merged

docs(core): Correct enableTurboModuleTracking docs and document TurboModule plumbing#6582
lucas-zimerman merged 1 commit into
mainfrom
alwx/docs/6168

Conversation

@alwx

@alwx alwx commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

📢 Type of change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring

📜 Description

Documentation only. No behaviour change, no public API change.

enableTurboModuleTracking's JSDoc claimed it forwards Turbo Module callbacks "to the higher-level Sentry instrumentation (crash attribution, per-module spans, aggregated stats)". Neither half holds:

  • It installs the native TurboModulePerfLogger, which forwards to a sink — and SentryTurboModulePerfController::setSink has no caller outside RNSentryCocoaTester. Enabling it emits nothing.
  • Everything the text promised comes from turboModuleContextIntegration(), registered whenever enableNative is true, which never reads this option.

The option is now @internal and documented accurately. Kept rather than removed: the native install path already shipped in 8.17.0 and a sink is the intended consumer.

Adds a packages/core/AGENTS.md section covering the two independent stacks and the traps in them — notably that logger from @sentry/core is the Logs API, not the debug logger, so the existing logger.warn calls in turbomodule/ capture log events from the wrap hot path and recurse through the wrapped RNSentry.captureEnvelope. Documented, not fixed, to keep this diff docs-only.

💡 Motivation and Context

First slice of #6168. Two of that issue's premises were wrong and are corrected here rather than propagated into docs: there is no turboModulesIntegration (it is turboModuleContextIntegration), and slowCallThresholdMs / ignoreTurboModules / maxTopModulesPerSpan are on TurboModuleContextOptions, not on the SDK options.

The attribute rename is not here — conventions must merge before an SDK ships them, so it is gated on getsentry/sentry-conventions#564.

💚 How did you test it?

No tests added — docs and JSDoc only.

yarn build:sdk, yarn api-report:check (surface unchanged), yarn lint (0 errors), yarn circularDepCheck, yarn test — 1850 + 334 + 1 passing.

Native and E2E suites not 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

  1. feat(attributes): Add React Native TurboModule call attributes sentry-conventions#564 — register and unify the attributes. Blocks the rest.
  2. SDK rename: apply the agreed keys, emit old + new through the backfill window, then lock the API report.
  3. sentry-docs PR.

Separate follow-ups: the loggerdebug fix in turbomodule/, and #6542. When #6561 lands, the AGENTS.md section needs the turboModuleCallbacks.ts row added back.

…Module plumbing

`enableTurboModuleTracking`'s documentation claimed it forwards Turbo Module
lifecycle callbacks "to the higher-level Sentry instrumentation (crash
attribution, per-module spans, aggregated stats)". Neither half holds.

The option installs the native `TurboModulePerfLogger`, which forwards to a
swappable sink — and `SentryTurboModulePerfController::setSink` has no caller
outside RNSentryCocoaTester. Enabling it forwards every callback into `nullptr`.
Everything the old text promised comes from `turboModuleContextIntegration()`, a
JS-side wrapper registered whenever `enableNative` is true, which never reads
this option. The two stacks share a name prefix and nothing else.

That made the option look like the feature's on/off switch, so it is now
`@internal` and its documentation says plainly that it emits nothing. Keeping it
rather than removing it: the native install path is already shipped and a sink is
the intended consumer, so the flag is the seam that work will land on.

The AGENTS.md section exists because the same confusion is a trap for anyone
touching this code, along with three others found while auditing it: `logger`
imported from `@sentry/core` is the Logs API rather than the debug logger, so the
existing `logger.warn` calls capture log events from the wrap hot path and
recurse through the wrapped `RNSentry.captureEnvelope`; the crash-attribution
frame must pop synchronously or an unrelated later native crash gets blamed on
the module; and the emitted attribute keys are split across `turbo_module.*` and
`turbo_modules.*` with the dynamic segment mid-key, which makes them
unregistrable in sentry-conventions.

Refs #6168
@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).


  • docs(core): Correct enableTurboModuleTracking docs and document TurboModule plumbing by alwx in #6582
  • chore(deps): update Maestro to v2.8.0 by github-actions in #6551
  • chore(deps): update Android SDK to v8.52.0 by github-actions in #6566
  • chore(deps): bump the codeql-action group with 3 updates by dependabot in #6572
  • chore(deps): bump getsentry/craft/.github/workflows/changelog-preview.yml from 2.28.0 to 2.30.0 by dependabot in #6573
  • chore(deps): bump getsentry/craft from 2.28.0 to 2.30.0 by dependabot in #6575
  • chore(deps): bump dorny/paths-filter from 4.0.2 to 4.0.3 by dependabot in #6574
  • chore(deps): bump nanoid from 3.3.8 to 3.3.18 by dependabot in #6579
  • chore(deps): bump gradle/actions/setup-gradle from 6.2.0 to 6.3.0 by dependabot in #6576
  • chore(ci): remove Cirrus runners and use only Bitrise by itaybre in #6563
  • fix(ios): Re-land SentrySDK.internal migration, bump Cocoa SDK to 9.24.0 by alwx in #6541
  • ci: Replace curl-pipe-bash with action-setup-cli for Sentry CLI setup by oioki in #6567

🤖 This preview updates automatically when you update the PR.

@github-actions

Copy link
Copy Markdown
Contributor
Fails
🚫 Pull request is not ready for merge, please add the "ready-to-merge" label to the pull request

Generated by 🚫 dangerJS against d045e37

@alwx
alwx marked this pull request as ready for review August 10, 2026 12:17

@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.

LGTM1

@lucas-zimerman
lucas-zimerman merged commit c974c52 into main Aug 10, 2026
67 of 73 checks passed
@lucas-zimerman
lucas-zimerman deleted the alwx/docs/6168 branch August 10, 2026 20:50
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