Skip to content

Send expected bootsplash, auth retry and Pusher teardown signals to Sentry logs instead of the error stream - #99789

Merged
rlinoz merged 3 commits into
mainfrom
claude-sentryNoiseToLogs
Aug 31, 2026
Merged

rlinoz merged 3 commits into
mainfrom
claude-sentryNoiseToLogs

Conversation

@MelvinBot

@MelvinBot MelvinBot commented Aug 28, 2026 •

Copy link
Copy Markdown
Contributor

Explanation of Change

Three call sites reported conditions their own code comments describe as expected, using Sentry's error stream. Each is now a Sentry log instead, so the signal is kept but stops counting against the error quota. This implements items 2 and 4 of the audit shortlist in #99784.

1. Bootsplash monitor (src/libs/telemetry/bootsplashTelemetry.ts)

startBootsplashMonitor called Sentry.captureMessage on every poll while the splash stayed visible, already at level: 'warning' — nobody triages it as a crash. It now calls Sentry.logger.warn with the same gate status. Same context, same cadence, just off the error stream.

2. Authentication network_retry (src/libs/telemetry/trackAuthenticationError.ts)

trackAuthenticationError sent every error type through Sentry.captureException, including network_retry. That is the UNABLE_TO_RETRY path in Reauthentication, whose comment states the request failed on a spotty connection, the user is deliberately not logged out, and the retry mechanism takes it from there — a routine offline condition sitting in the error stream.

network_retry now goes to Sentry.logger.warn with its tags preserved as log attributes, so it stays searchable by authentication_function / authentication_json_code. Every other error type (missing_params, auth_failure, unexpected_error) still captures an exception, unchanged. This mirrors the classification trackMFAFlowOutcome already does, where routine outcomes are logged and only anomalous ones become events.

3. Pusher subscribe-after-disconnect (src/libs/Pusher/index.ts, index.native.ts)

Pusher.subscribe captured an exception when socket was gone in production. The comment on that branch already says this happens when disconnect() runs during the "Upgrade Required" teardown before the deferred TransitionTracker callback does — a teardown race, not a crash. It now logs. The __DEV__ branch is untouched, so a genuine subscribe-before-init in development still rejects the promise loudly.

Note on scope: this is a telemetry-routing change only. No user-facing behavior changes, and no diagnostic signal is removed — all three still report, just to Sentry logs (enableLogs: true is already set in setupSentry) rather than the error stream.

Fixed Issues

$ #99784
PROPOSAL: #99784 (comment)

Tests

// TODO: The human co-author must fill out the tests you ran before marking this PR as "ready for review"
// Please describe what tests you performed that validates your changed worked.

  • Verify that no errors appear in the JS console

Offline tests

// TODO: The human co-author must fill this out. The network_retry path in change 2 is reached by going offline or dropping the connection mid-reauthentication, so an offline pass is directly relevant here.

QA Steps

// TODO: These must be filled out, or the issue title must include "[No QA]."

// TODO: The human co-author must fill out the QA tests you ran before marking this PR as "ready for review".
// Please describe what QA needs to do to validate your changes and what areas do they need to test for regressions.

  • Verify that no errors appear in the JS console

PR Author Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
    • I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • Android: Native
    • Android: mWeb Chrome
    • iOS: Native
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
  • I followed proper code patterns (see Reviewing the code)
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I followed the guidelines as stated in the Review Guidelines
  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))
  • If new assets were added or existing ones were modified, I verified that:
    • The assets are optimized and compressed (for SVG files, run npm run compress-svg)
    • The assets load correctly across all supported platforms.
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • I added unit tests for any new feature or bug fix in this PR to help automatically prevent regressions in this user flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.

Screenshots/Videos

Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari

AI Tests run by MelvinBot

Check Result
npm run typecheck ✅ passed
npm run lint-changed ✅ passed
npm run spell-changed -- src/libs/telemetry/bootsplashTelemetry.ts ✅ passed (0 issues)
npm run fmt (Oxfmt) ✅ passed — no diff
npm test -- --silent tests/unit/PusherSubscribeTest.ts tests/unit/PusherSubscribeWebTest.ts tests/unit/PusherPingPongTest.ts ✅ 28/28 passed

Not run, with reasons:

  • Full npm test — only the existing suites covering the touched code were run, listed above.
  • npm run storybook -- --smoke-test --ci and npm run react-compiler-compliance-check check-changed — no components, hooks, or .tsx files changed.

No unit tests are added. Per reviewer feedback the PR is a straight telemetry-routing swap at four call sites, with no behavior to assert beyond which Sentry API is called.

…entry logs instead of the error stream

The bootsplash monitor captured an event every 10s for as long as the splash stayed up, so a single stuck boot emitted unbounded error-stream volume. It now forwards a Sentry log carrying how long the gate stayed shut, capped at six reports.

trackAuthenticationError sent the retryable UNABLE_TO_RETRY path as an exception even though the user is deliberately kept signed in and the retry mechanism handles it. That error type now goes to Sentry logs, keeping its tags as log attributes; every other error type still captures an exception.

Pusher.subscribe captured an exception when the socket was gone, a race its own comment describes as expected during Upgrade Required teardown. It now logs instead, on both web and native.

Co-authored-by: Rodrigo Lino da Costa <rlinoz@users.noreply.github.com>
@melvin-bot melvin-bot Bot added Melvin-Test-Android Melvin-Test-Web Triggers Melvin to run the testing steps of the PR on web labels Aug 28, 2026
@MelvinBot
MelvinBot requested a review from a team August 28, 2026 20:21
@codecov

codecov Bot commented Aug 28, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.

Files with missing lines Coverage Δ
src/libs/Pusher/index.native.ts 79.37% <100.00%> (-0.72%) ⬇️
src/libs/telemetry/trackAuthenticationError.ts 100.00% <100.00%> (ø)
src/libs/Pusher/index.ts 57.96% <0.00%> (+4.50%) ⬆️
src/libs/telemetry/bootsplashTelemetry.ts 41.66% <0.00%> (ø)
... and 153 files with indirect coverage changes

Co-authored-by: Rodrigo Lino da Costa <rlinoz@users.noreply.github.com>
@MelvinBot

Copy link
Copy Markdown
Contributor Author

Fixed and pushed — Oxfmt check now passes.

Cause: one line in the new test file was 191 characters, one over the printWidth: 190 set in .oxfmtrc.json. npm run fmt rewrote it, so the "no Oxfmt diff" gate failed.

Fix: wrapped that call's arguments the way oxfmt formats them, in tests/unit/trackAuthenticationErrorTest.ts:25 (commit 54d21a7). Whitespace only — no assertion changed.

The only remaining failure is Check independent approval, which just needs a human reviewer. All 8 test jobs, typecheck, ESLint check, spellcheck, Bun tests, Storybook tests, and the builds pass on the new commit; the two perf jobs are still running.

Why the earlier local run missed it

The AI-test table in the PR body lists ESLint, typecheck, spellcheck, and Jest — none of which enforce oxfmt's print width, and npm run fmt was skipped on the reasoning that ESLint was the formatting gate. It isn't; Oxfmt check is a separate required job. Running npm run fmt before committing would have caught this.

In this run I could not execute npm run fmt (the sandbox blocked npm and node_modules binaries), so I derived the wrap from the config and confirmed against CI, which now passes.


view run

@MelvinBot

Copy link
Copy Markdown
Contributor Author

Web test run: ✅ pass

Ran this PR's testing steps on Web against the claude-sentryNoiseToLogs branch (HEAD ecd48a1). No user-facing regression: the app booted to Home, chat and Settings navigation worked, and a full offline → online cycle completed cleanly with zero failed HTTP requests.

Step Status Observation
App boots past bootsplash and reaches Home with no hang ✅ pass Session resumed on the post-join loading screen; after clicking Join the app settled directly onto the Home tab (heading "Home", Expense/Report/Distance quick actions, Concierge intro) with no stuck splash.
No errors in JS console after app loads and reaches Home ✅ pass agent-device web has no browser-console command (logs returns UNSUPPORTED_OPERATION on this platform), so network dump was used as the proxy: OpenApp, AuthenticatePusher, SearchForTodos, UpdateAutomaticTimezone, Search, Log, PusherPing and all bundle/asset fetches returned 200. No 4xx/5xx, no error boundary or red screen.
Navigate to a chat and Settings — no console errors during normal use ✅ pass Opened Inbox → Concierge chat (welcome message rendered) and Account → Profile → Preferences → Troubleshoot; all screens rendered correctly. network dump for this window showed only 200s (OpenReport, OpenInitialSettingsPage, OpenTroubleshootSettingsPage, PusherPing, Ping).
Offline pass: offline indicator appears, navigation/send works, no console errors ✅ pass Enabled Settings → Troubleshoot → "Force offline". The "You appear to be offline" banner appeared. Navigated to Inbox and sent "Testing offline message send" — the message queued in the thread with no error dialog. network dump showed only 200s.
Back online: indicator clears, pending message syncs, no console errors ✅ pass Disabled "Force offline" — dependent toggles unlocked and the offline banner disappeared. network dump immediately showed ReconnectApp, OpenReport (×2), AddComment, GetNewerActions, SearchForTodos, Log all at 200. Reopened the Concierge chat and the queued message displayed as delivered, no pending/error state. Full-session scan: zero 4xx/5xx end to end.
Evidence (6)

App booted to Home after bootsplash, no hang

App booted to Home after bootsplash, no hang

Concierge chat and Settings/Profile navigation working normally

Concierge chat and Settings/Profile navigation working normally

Force offline enabled; 'You appear to be offline' banner visible

Force offline enabled; 'You appear to be offline' banner visible

Message sent while offline is queued in the chat

Message sent while offline is queued in the chat

Force offline disabled, offline banner cleared

Force offline disabled, offline banner cleared

Reconnected: queued message delivered normally after coming back online

Reconnected: queued message delivered normally after coming back online

Two caveats on coverage

1. "No JS console errors" was verified indirectly. The web harness has no browser-console command, so the check was zero failed HTTP requests across the whole session plus no error-boundary/crash UI in any screenshot. That is weaker than reading console.error directly — a caught-and-logged JS error would not show up.

2. The offline pass used the in-app simulator, not a real network cut. Settings → Troubleshoot → "Force offline" marks the app offline for the banner and the optimistic queue, but it does not drop the socket. So this run exercised the offline UX, not the network_retry / UNABLE_TO_RETRY reauthentication path that change 2 modifies. That path needs a genuine mid-reauthentication connection drop, which this environment can't produce. tests/unit/trackAuthenticationErrorTest.ts covers the routing for it at the unit level.

Also worth noting for the record: because all three changes route signals to Sentry rather than change behavior, a passing manual web run confirms no regression but cannot confirm the signals actually landed in Sentry logs. Confirming that needs a look at the Sentry project after this deploys.


view run

@MelvinBot

MelvinBot commented Aug 28, 2026 •

Copy link
Copy Markdown
Contributor Author

Android test run: ✅ pass

Ran this PR's testing steps on Android (standalone developmentDebug NewDot on an emulator) against the claude-sentryNoiseToLogs branch. The app booted past the bootsplash to Home, normal navigation produced no new JS errors, and a full offline → online cycle worked cleanly.

Step Status Observation
App boots past bootsplash and reaches Home without hanging ✅ pass logcat shows a normal SplashScreenView remove plus the JS Sentry spans BootsplashVisible / BootsplashVisibleOnyx / … / BootsplashVisibleDeepLink completing in sequence. Home rendered ("Good evening, Melvin.") with no stuck-splash symptoms.
No errors in JS/console log output after load ✅ pass Grep for console.error / E-ReactNativeJS / FATAL EXCEPTION around boot found only two pre-existing dev-only RN warnings (see below). No crashes, no new errors.
Normal navigation (chat, Settings) produces no log errors ✅ pass Opened Inbox → Concierge report and the Settings/Account page. Grep of the log between the Verify2-start-home-reached and Verify3-after-navigation marks shows zero new console.error / E-ReactNativeJS / crash lines.
Offline pass: indicator appears, send works, no log errors ✅ pass Disabled emulator network (adb svc data/wifi disable, confirmed via dumpsys connectivity → "Active default network: none"). The "You appear to be offline" banner appeared and a sent message ("Testing offline message") queued pending sync. Log shows the expected non-fatal internal API failure for AuthenticatePusher (ERR_INTERNET_DISCONNECTED) and "Pusher PINGPONG] Skipping PING because the client is offline" — handled internally, no console.error output.
Back online: reconnects, indicator clears, pending action syncs, no log errors ✅ pass Re-enabled network; banner disappeared, the pending message rendered as synced with a full-color avatar, compose bar returned to normal. Log shows "[Reconnect] Offline→online, flushing queue", "[Reconnect] Triggering reconnection", a successful ReconnectApp call (jsonCode 200), and the Sentry span ManualReconnectServerResponse…attempt: 4. Zero new console.error / E-ReactNativeJS / crash entries.
Evidence (6)

Home screen reached after boot

Home screen reached after boot

Concierge chat report open

Concierge chat report open

Settings/Account page

Settings/Account page

Offline indicator visible in chat

Offline indicator visible in chat

Message queued while offline

Message queued while offline

Back online, message synced, offline indicator cleared

Back online, message synced, offline indicator cleared

Console output worth noting

Two E/ReactNativeJS lines appeared during boot. Both are pre-existing dev-only warnings, not regressions from this change:

  • The result of getSnapshot should be cached to avoid an infinite loop
  • The action 'DISMISS_MODAL' was not handled by any navigator. This is a development-only warning and won't be shown in production.

Coverage note

The offline pass here was a real network cut (adb svc data/wifi disable), not an in-app simulator — stronger than the web run, which could only use the "Force offline" toggle. The socket genuinely dropped, and the logs confirm it: AuthenticatePusher failed with ERR_INTERNET_DISCONNECTED and Pusher skipped its PING. That exercises the connection-loss territory around change 2, though I did not observe a network_retry / UNABLE_TO_RETRY event specifically, since that requires the drop to land mid-reauthentication. tests/unit/trackAuthenticationErrorTest.ts covers that routing at the unit level.

As with the web run: because all three changes only reroute signals to Sentry, a passing manual run confirms no regression but cannot confirm the signals actually landed in Sentry logs. That needs a look at the Sentry project after this deploys.


view run

Evidence (1)

Recordings

- [▶ Session recording of the verification run](https://melvinbot-assets.exops.io/session-33207906168-1-478c9aaf-969d-43a6-a71f-3b7aae301a98.mp4)

@rlinoz

rlinoz commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

@MelvinBot this PR should be simpler, drop the tests, and make src/libs/telemetry/bootsplashTelemetry.ts a single line change, same as you did in the other places.

Co-authored-by: Rodrigo Lino da Costa <rlinoz@users.noreply.github.com>
@MelvinBot

Copy link
Copy Markdown
Contributor Author

Done — pushed 581998d.

Dropped both test files (tests/unit/bootsplashTelemetryTest.ts, tests/unit/trackAuthenticationErrorTest.ts).

bootsplashTelemetry.ts is now the same one-line swap as the other call sites — no cap, no stuckForMs/reportNumber, no extracted constants:

-        Sentry.captureMessage('[BootSplash] splash screen is still visible', {
-            level: 'warning',
-            extra: {...currentGateStatus, appState},
-            fingerprint: ['bootsplash-stuck'],
-        });
+        Sentry.logger.warn('[BootSplash] splash screen is still visible', {...currentGateStatus, appState});

The PR is now 4 files, all telemetry routing:

File Change
src/libs/telemetry/bootsplashTelemetry.ts +1 / -5
src/libs/telemetry/trackAuthenticationError.ts +12 / -0
src/libs/Pusher/index.ts +7 / -6
src/libs/Pusher/index.native.ts +7 / -6

I left trackAuthenticationError.ts and the Pusher files alone, since you pointed at them as the model. Say the word if you also want the one-entry NON_ACTIONABLE_ERROR_TYPES set collapsed to a direct errorType === 'network_retry' check.

I also updated the PR body, which still described the removed cap and tests.

Checks: all green on 581998d except Check independent approval, which just needs a reviewer — typecheck, ESLint check, Oxfmt check, spellcheck, all 8 test jobs, Bun tests, Storybook tests, React Compiler Compliance, both perf jobs, and the builds pass. Locally: npm run typecheck, npm run lint-changed, npm run fmt (no diff), npm run spell-changed, and the three existing Pusher suites (28/28).

Web re-test was blocked by the test session, not by this change

I tried to re-run the web smoke test on 581998d. The browser session never rendered anything — blank page, zero accessibility nodes, and zero HTTP entries captured for its whole lifetime, from the first screenshot onward. The dev server itself was fine (curl returned 200 and the bundles served instantly), so this was a session/infra stall, not the app failing to boot.

The earlier web and Android runs on this branch both passed, and they covered a strict superset of what is here now: this commit only removes code (the report cap, the extra log attributes, the tests). No behavior was added.


view run

@MelvinBot

Copy link
Copy Markdown
Contributor Author

No fix to push — every real check passes on the current HEAD (581998d).

The single remaining failure is Check independent approval, whose failing step is Verify peer review. No review has been submitted yet (PullerBear is still the only requested reviewer), so this is a human-approval gate, not something a code change can clear.

The "failing checks" that prompted this request were from the previous commit and the in-flight run. Across the whole branch history there has been exactly one genuine failure — Oxfmt check on 8/28 — and that was already fixed in 54d21a7.

Check-by-check status on 581998d

All of these pass: typecheck, ESLint check, Oxfmt check, spellcheck, Bun tests, test (jobs 1-8), Storybook tests, Knip check, Check for unused styles, React Compiler Compliance, codecov/patch, codecov/project, verifySignedCommits, CLA, both Android builds, both iOS builds, and branch-perf-tests / baseline-perf-tests.

Failing: Check independent approval — job log. Step Verify peer review failed; all preceding steps succeeded.

Your simplification request landed correctly

581998d reduced src/libs/telemetry/bootsplashTelemetry.ts to exactly main plus one line, matching the other two call sites:

Sentry.logger.warn('[BootSplash] splash screen is still visible', {...currentGateStatus, appState});

I verified this against main directly — the MAX_STUCK_REPORTS throttle that the earlier commit had introduced was never on main, and it is now gone, so the file carries no leftover scaffolding. The added unit tests were dropped as you asked.

One thing I could not verify

I tried to re-run the web flow against 581998d, since the last web/Android passes predate the simplification. The attempt was inconclusive: the browser session was already blank and idle when the tester picked it up (0 accessibility nodes, solid-white screenshot, 0% renderer CPU throughout), so it never reached Home and no step could be exercised. The dev server itself was healthy and serving the built bundles.

This looks like an idle-tab discard caused by the ~11 minute gap while I was waiting on CI checks, not a fault in the diff — but I did not observe a passing boot, so I am not claiming one. Weighing against a regression: the diff on this file is a single-line swap between two Sentry calls with no control-flow change, and test (jobs 1-8) plus both native builds are green. If you want a clean signal before merging, re-running the Melvin-Test-Web label will drive a fresh session.

Evidence (2)

Blank white web session at handoff - 0 accessibility nodes

Blank white web session at handoff - 0 accessibility nodes

Still blank after ~5 minutes, renderer CPU at 0%

Still blank after ~5 minutes, renderer CPU at 0%

view run

@rlinoz
rlinoz marked this pull request as ready for review August 31, 2026 13:20
@rlinoz
rlinoz requested a review from a team as a code owner August 31, 2026 13:20
@melvin-bot
melvin-bot Bot requested a review from abdulrahuman5196 August 31, 2026 13:20
@melvin-bot

melvin-bot Bot commented Aug 31, 2026

Copy link
Copy Markdown

@abdulrahuman5196 Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button]

@melvin-bot
melvin-bot Bot requested review from garrettmknight and removed request for a team August 31, 2026 13:20
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 31, 2026 •

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-08-31T13:35:08.447963Z 581998d Draft marked ready
ℹ️ 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.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 581998dfc5

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +52 to +54
if (NON_ACTIONABLE_ERROR_TYPES.has(errorType)) {
Sentry.logger.warn(`[Authentication] ${errorType}`, {...tags, ...extra, errorMessage: errorMessage ?? error.message});
return;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Avoid recapturing network retries as unexpected errors

When Authenticate returns UNABLE_TO_RETRY, Reauthentication.ts calls this logging branch and then throws the same error; the chain's .catch() subsequently classifies it as unexpected_error, causing trackAuthenticationError to call Sentry.captureException after all. Consequently, routine offline retries still enter the Sentry error stream and consume its quota, so this path needs to bypass the second telemetry capture while preserving the retry rejection.

Useful? React with 👍 / 👎.

@garrettmknight
garrettmknight removed their request for review August 31, 2026 19:02
@rlinoz
rlinoz removed the request for review from abdulrahuman5196 August 31, 2026 19:58
@rlinoz

rlinoz commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

No need for a review

@rlinoz
rlinoz merged commit ed7fc52 into main Aug 31, 2026
46 of 49 checks passed
@rlinoz
rlinoz deleted the claude-sentryNoiseToLogs branch August 31, 2026 20:13
@github-actions

Copy link
Copy Markdown
Contributor

🚧 rlinoz has triggered a test Expensify/App build. You can view the workflow run here.

@OSBotify OSBotify mentioned this pull request Sep 2, 2026
82 tasks done
@OSBotify

OSBotify commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by https://github.com/rlinoz in version: 9.4.66-0 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

@MelvinBot

Copy link
Copy Markdown
Contributor Author

🤖 No help site changes are required for this PR. I did not create a docs PR.

Why: every change in this PR reroutes an internal Sentry signal from the error stream to Sentry logs. Nothing a customer sees or does changes.

Review details

What changed (4 files, all under src/libs/):

File Change
src/libs/Pusher/index.ts:281 and index.native.ts:263 Sentry.captureException → Sentry.logger.warn for the subscribe-after-disconnect teardown race
src/libs/telemetry/bootsplashTelemetry.ts:46 Sentry.captureMessage → Sentry.logger.warn for the still-visible splash poll
src/libs/telemetry/trackAuthenticationError.ts:52-55 network_retry now routes to Sentry.logger.warn; all other error types still capture an exception

Checks against the help site criteria:

  • No user-facing behavior change. The PR body states this explicitly, and the diff confirms it — no conditionals were added or removed around app behavior, only the Sentry API being called.
  • No UI copy, labels, buttons, tabs, or settings changed. No files under src/languages/, no .tsx files, no new or renamed features.
  • No feature added, removed, or gated. Nothing to document as a new capability or workflow step.
  • Nothing in docs/articles covers this area. I searched the full help site tree for sentry, bootsplash, and pusher — zero matches. Expensify's help site documents customer workflows, not internal error reporting or crash telemetry, so there is no existing article that becomes inaccurate because of this change.

The network_retry path is the closest thing to something a customer experiences (a request failing on a spotty connection during reauthentication), but the app's handling of it is unchanged — the user is still kept signed in and the retry mechanism still takes over. Only where that event gets recorded in Sentry changed, which is invisible to customers and not documented on the help site.

Because there is no docs change to make, there is no help site PR to link, no HelpDot label to apply, and nothing to assign.

@rlinoz, please confirm you agree that no help site update is needed here. If you think a specific article should still be touched, reply with @MelvinBot and point me at it and I'll open the draft PR.


view run

@kavimuru

kavimuru commented Sep 2, 2026

Copy link
Copy Markdown

@rlinoz anything to be tested for QA?

@rlinoz

rlinoz commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

No, this is NO QA sorry.

@OSBotify

OSBotify commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by https://github.com/rlinoz in version: 9.4.68-0 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 cancelled 🔪

@MelvinBot

Copy link
Copy Markdown
Contributor Author

🤖 No help site changes are required for this PR, so I did not create a docs PR.

This is a telemetry-routing change only. All four call sites still report the same signal with the same context — they just send it to Sentry logs (Sentry.logger.warn) instead of the Sentry error stream (captureException / captureMessage).

Why no article needs updating

Nothing user-facing changed. The help site under App/docs/articles documents what members, admins, and accountants see and do in the product — workspace settings, expense flows, connections, billing. It does not document internal instrumentation. A change in which Sentry API a code path calls is invisible to every reader of those articles.

Checked each change:

Change User-visible effect
bootsplashTelemetry.ts — splash-still-visible poll None. The splash behavior itself is unchanged; only the report destination moved.
trackAuthenticationError.ts — network_retry None. The comment and the UNABLE_TO_RETRY path confirm the user is deliberately kept signed in and the retry mechanism handles it. Same behavior as before.
Pusher/index.ts + index.native.ts — subscribe after disconnect None. The __DEV__ branch is untouched; production still resolves and carries on, exactly as before.

Searched the docs for any affected content. No article under docs/articles references Sentry, the bootsplash, Pusher, error reporting, or app-level reauthentication. The only hits for "reauthenticate" are accounting-connection articles (Xero XERO11, Sage Intacct INT122 / INT176), which describe reconnecting an integration to its accounting provider — unrelated to the Reauthentication code path in this PR.

No behavior to verify in the UI, so I didn't run a test pass. There is no screen, label, button, or flow that renders differently before and after this diff.

If this ever does need docs: it would be at the point a user notices something — for example, if the "Upgrade Required" teardown or a spotty-connection reauthentication started showing a different message or leaving the user signed out. Neither happens here.

Since no docs PR was created, there is nothing for you to review, and I've skipped the HelpDot label and assignment steps. If you'd still like an article drafted — or if you know of behavior in this area that the help site currently gets wrong — reply with @MelvinBot and what you'd like covered, and I'll open the draft PR.


view run

@OSBotify

OSBotify commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/francoisl in version: 9.4.68-1 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

Bundle Size Analysis (Sentry):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Melvin-Test-Android Melvin-Test-Web Triggers Melvin to run the testing steps of the PR on web

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants