Skip to content

fix(mobile): bump @sentry/react-native to 8.36 to stop the expo-router Metro warning (APP-545) - #319

Merged
AppElent merged 4 commits into
mainfrom
fix/app-545-sentry-expo-router-warning
Nov 25, 2026
Merged

AppElent merged 4 commits into
mainfrom
fix/app-545-sentry-expo-router-warning

Conversation

@AppElent

@AppElent AppElent commented Nov 23, 2026 •

Copy link
Copy Markdown
Owner

Fixes APP-545

Risk: med. Native SDK bump (@sentry/react-native 8.31 → 8.36) that changes the runtime fingerprint.

What

Metro warned on every bundle that expo-router@58.0.32 has an invalid exports entry for ./build/global-state/router-store. The cause is not expo-router (58.0.32 is its newest 58.0.x). @sentry/react-native@8.31.0 deep-imports expo-router/build/global-state/router-store in dist/js/tracing/expoRouterStore.js, a file expo-router 58 no longer ships. Sentry 8.33.0 reads useNavigationContainerRef from expo-router instead (getsentry/sentry-react-native#6923).

  1. Bumped @sentry/react-native to ~8.36.0, the newest 8.x. It stays in expo.install.exclude, so it was bumped by hand. @sentry/cli now resolves to the pinned 3.8.2. No Sentry.init option used in apps/mobile/src/observability/sentry.ts was removed or renamed; jest.setup.ts needed no change.
    Touch breadcrumbs: since 8.35 (#7013) touch and rage-tap breadcrumbs work again on React Native 0.88, and their message is an accessibility label that can carry workout and nutrition values. The Opus code review caught this and I added a guard here. After merging main (25 Nov), main already drops ui.click, ui.input, touch and ui.multiClick breadcrumbs and sanitizes breadcrumbs merged into events, so my guard was dropped in favour of it. This PR now changes only apps/mobile/package.json and pnpm-lock.yaml.

Other default-behaviour changes in 8.32–8.36, checked and without effect here: native Android logs under enableLogs (8.34; logsOrigin: "js" keeps this off) and expo/fetch detection (8.34; no change with @expo/metro-runtime 58.0.17). 8.34/8.35 otherwise add opt-in features. Android Sentry Gradle plugin constant moves 6.23.0 → 6.27.0; covered by the next Android build.

Expected effect on telemetry: with 8.31 against expo-router 58 the store lookup failed, so expoRouterIntegration returned early and was not registered. After this ships, navigation transactions (with route names, TTID and profiles) resume. Watch the Sentry quota (100% sampling on preview, 20% on production). route.url and route params stay gated by sendDefaultPii: false.

Review

Code review by Opus 5.5 (read-only subthread): round 1 REVISE (touch breadcrumb privacy blocker; fixed by a guard, since superseded by the equivalent guard on main), round 2 PROCEED on that guard. The native SDK binaries (Cocoa 9.35, Android 8.64) were not inspected by the reviewer either.

Evidence

  • Before: expo export --platform ios printed the "however this file does not exist" warning repeatedly (resolved from @sentry+react-native@8.31.0).
  • After: same command with a cleared cache bundles 3466 modules with 0 occurrences of router-store or however this file does not exist.
  • pnpm verify: exit 0 (Vitest 123 files / 1026 tests, mobile Jest 132 suites / 1175 tests, lint, types, project checks), re-run after merging main on 25 Nov: 1191 Vitest, 1259 Jest.
  • App run in the iOS simulator through run-mobile.mjs up (Metro on :8091, backend check passed): signed in and reached Home with the five tabs; Metro log has no router-store warning.
  • Runtime fingerprint (node apps/mobile/scripts/fingerprint.mjs) changed in every profile and platform:
Profile iOS before → after Android before → after
preview c5a1ec9c → 23338ce2 9b2444be → 0ac1f9c8
production dfc1e0f3 → 8b574a6b cac1a803 → cca02ee6
development 6eb2029a → ea1e5230 50efa582 → ea98b011

After merge, OTA updates for this runtime wait for a matching store build on both channels, and so does every later change until that build ships. Needs Eric's card before merge.

Not verified

  • The simulator run reused an existing development client already built from another checkout (native Sentry 8.31 pods) against 8.36 JavaScript. No native rebuild; no Android run.
  • Sentry is disabled in __DEV__, so no event payload was inspected and route names on navigation spans were not seen live. The check is the shipped code reading the exported useNavigationContainerRef (present in expo-router 58). Confirm route names on spans and the absence of touch breadcrumbs in Sentry after the next store build.

Leftover work

  • Dev-only WARN navigation.isFocused() was called during render appears in Metro on Home; unrelated, not investigated.
  • Repeat the simulator check with a freshly built development client at the next native build.
  • Native (unconfirmed): breadcrumbs the iOS and Android SDKs create themselves may skip beforeBreadcrumb (the Cocoa binary may record button titles for UIControl taps); sanitizeEvent on main now scrubs breadcrumbs merged into events. Confirm on a device build; enableUserInteractionBreadcrumbs on Android is not set.
  • Optional guard: assert in sentry.test.ts that enableUserInteractionTracing stays off, because enabling it would put labels in transaction names and sanitizeEvent does not scrub those.

🤖 Generated with Claude Code

…r Metro warning (APP-545)

8.31 deep-imported expo-router/build/global-state/router-store, which expo-router 58 no longer ships, so Metro warned on every bundle and expoRouterIntegration never got route names. 8.33 reads useNavigationContainerRef from expo-router instead.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-25T10:14:49.713796Z
We couldn’t complete this review. Comment @codex review to try again.
942c659 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@AppElent AppElent added the blast-radius:med Features, UI flows, shared behaviour, new dependencies. One code review label Nov 23, 2026
…cessibility labels (APP-545)

Sentry 8.35 restores touch breadcrumbs on React Native 0.88; their message is the tapped element's accessibility label, which carries workout and nutrition values and the account name.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@AppElent

Copy link
Copy Markdown
Owner Author

Code review, round 1 (Opus 5.5, med): REVISE

Blocker: Sentry 8.35+ restores touch and rage-tap breadcrumbs on RN 0.88 (getsentry/sentry-react-native#7013). Their message is the tapped element's accessibility label, which in Foundry carries workout and nutrition values and the account name; maskAllText does not mask it and sanitizeBreadcrumb kept message. Rule: "Workout and nutrition values stay out of telemetry" (docs/runbooks/sentry.md).

Suggestions (taken in the PR body): changelog claim corrected; navigation side effect and quota note; fingerprint/OTA wording; extra 'Not verified' items; Android Gradle plugin constant 6.23.0 → 6.27.0.

Fix pushed in 45fe200: sanitizeBreadcrumb drops touch and ui.multiClick breadcrumbs, with a test. Round 2 checks only this fix.

@AppElent

Copy link
Copy Markdown
Owner Author

Code review, round 2 (Opus 5.5, med): PROCEED. The round-1 blocker is fixed: touch and ui.multiClick are the only automatic label-carrying breadcrumbs in 8.36.0, beforeBreadcrumb returns null before they reach the scope, native sync or replay, enableUserInteractionTracing is off, and the web app never emits touch. Non-blocking follow-ups (web ui.click aria-label text, native-created breadcrumbs, a guard test for enableUserInteractionTracing) are listed under Leftover work in the PR body.

…po-router-warning

# Conflicts:
#	packages/core/src/observability.test.ts
#	packages/core/src/observability.ts
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@AppElent

Copy link
Copy Markdown
Owner Author

Conflict resolved (25 Nov). Merged origin/main (54069ca) into the branch, head 7c52a4f. The only conflicts were packages/core/src/observability.ts and its test: main now has a broader breadcrumb guard (drops ui.click, ui.input, touch, ui.multiClick and sanitizes breadcrumbs merged into events), so I took main's version and dropped my 45fe200 guard. The PR now changes only apps/mobile/package.json (@sentry/react-native ~8.36.0) and pnpm-lock.yaml; pnpm install --frozen-lockfile is clean.

  • pnpm verify: exit 0 (1191 Vitest, 1259 Jest).
  • CI check: pass. PR is MERGEABLE / CLEAN.
  • Native fingerprint: changed. Current main gives preview iOS c5a1ec9c, production iOS dfc1e0f3, development iOS 6eb2029a (Android 9b2444be, cac1a803, 50efa582); this branch gives preview iOS 23338ce2, production iOS 8b574a6b, development iOS ea1e5230 (Android 0ac1f9c8, cca02ee6, ea98b011). Sentry is a native module, so the fix reaches users only with a new store build, and OTA updates for this runtime wait for a matching store build. Needs Eric's card before merge. Not merged.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@AppElent
AppElent merged commit 7db20d4 into main Nov 25, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

blast-radius:med Features, UI flows, shared behaviour, new dependencies. One code review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant