Repository navigation
Send expected bootsplash, auth retry and Pusher teardown signals to Sentry logs instead of the error stream - #99789
Conversation
…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>
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.
|
Co-authored-by: Rodrigo Lino da Costa <rlinoz@users.noreply.github.com>
|
Fixed and pushed — Cause: one line in the new test file was 191 characters, one over the Fix: wrapped that call's arguments the way oxfmt formats them, in The only remaining failure is Why the earlier local run missed itThe AI-test table in the PR body lists ESLint, typecheck, spellcheck, and Jest — none of which enforce oxfmt's print width, and In this run I could not execute |
Android test run: ✅ passRan this PR's testing steps on Android (standalone
Evidence (6)Home screen reached after boot
Concierge chat report open
Settings/Account page
Offline indicator visible in chat
Message queued while offline
Back online, message synced, offline indicator cleared
Console output worth notingTwo
Coverage noteThe offline pass here was a real network cut ( 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. Evidence (1)Recordings- [▶ Session recording of the verification run](https://melvinbot-assets.exops.io/session-33207906168-1-478c9aaf-969d-43a6-a71f-3b7aae301a98.mp4) |
|
@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>
|
Done — pushed Dropped both test files (
- 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:
I left I also updated the PR body, which still described the removed cap and tests. Checks: all green on Web re-test was blocked by the test session, not by this changeI tried to re-run the web smoke test on 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. |
|
No fix to push — every real check passes on the current HEAD ( The single remaining failure is 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 — Check-by-check status on
|
|
@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] |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 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".
| if (NON_ACTIONABLE_ERROR_TYPES.has(errorType)) { | ||
| Sentry.logger.warn(`[Authentication] ${errorType}`, {...tags, ...extra, errorMessage: errorMessage ?? error.message}); | ||
| return; |
There was a problem hiding this comment.
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 👍 / 👎.
|
No need for a review |
|
🚧 rlinoz has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/rlinoz in version: 9.4.66-0 🚀
|
|
🤖 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 detailsWhat changed (4 files, all under
Checks against the help site criteria:
The Because there is no docs change to make, there is no help site PR to link, no @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 |
|
@rlinoz anything to be tested for QA? |
|
No, this is NO QA sorry. |
|
🚀 Deployed to staging by https://github.com/rlinoz in version: 9.4.68-0 🚀
|
|
🤖 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 ( Why no article needs updatingNothing user-facing changed. The help site under Checked each change:
Searched the docs for any affected content. No article under 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 |
|
🚀 Deployed to production by https://github.com/francoisl in version: 9.4.68-1 🚀
Bundle Size Analysis (Sentry): |














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)startBootsplashMonitorcalledSentry.captureMessageon every poll while the splash stayed visible, already atlevel: 'warning'— nobody triages it as a crash. It now callsSentry.logger.warnwith the same gate status. Same context, same cadence, just off the error stream.2. Authentication
network_retry(src/libs/telemetry/trackAuthenticationError.ts)trackAuthenticationErrorsent every error type throughSentry.captureException, includingnetwork_retry. That is theUNABLE_TO_RETRYpath inReauthentication, 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_retrynow goes toSentry.logger.warnwith its tags preserved as log attributes, so it stays searchable byauthentication_function/authentication_json_code. Every other error type (missing_params,auth_failure,unexpected_error) still captures an exception, unchanged. This mirrors the classificationtrackMFAFlowOutcomealready 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.subscribecaptured an exception whensocketwas gone in production. The comment on that branch already says this happens whendisconnect()runs during the "Upgrade Required" teardown before the deferredTransitionTrackercallback 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: trueis already set insetupSentry) 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.
Offline tests
// TODO: The human co-author must fill this out. The
network_retrypath 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.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
AI Tests run by MelvinBot
npm run typechecknpm run lint-changednpm run spell-changed -- src/libs/telemetry/bootsplashTelemetry.tsnpm run fmt(Oxfmt)npm test -- --silent tests/unit/PusherSubscribeTest.ts tests/unit/PusherSubscribeWebTest.ts tests/unit/PusherPingPongTest.tsNot run, with reasons:
npm test— only the existing suites covering the touched code were run, listed above.npm run storybook -- --smoke-test --ciandnpm run react-compiler-compliance-check check-changed— no components, hooks, or.tsxfiles 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.