[No QA] Add web crash diagnostics to detect abnormal browser session exits#94201
Draft
sosek108 wants to merge 1 commit into
Draft
[No QA] Add web crash diagnostics to detect abnormal browser session exits#94201sosek108 wants to merge 1 commit into
sosek108 wants to merge 1 commit into
Conversation
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Explanation of Change
What changed: Added a web-only crash detector (
src/libs/telemetry/crashDiagnostics/), initialized fromExpensify.tsx. The memory read reuses the sharedgetMemoryInfo()helper rather than readingperformance.memorydirectly.Why: A browser tab crash (typically out-of-memory) kills JS instantly, so Sentry can never report it from the dying session.
How it works: While the app runs, it writes a heartbeat plus a ring buffer of samples (used/total JS heap, heap limit, DOM node count, active route, Onyx report count) to localStorage every 15 seconds. Closing or refreshing the tab marks the session as cleanly exited via
pagehide. On the next launch — or from another live tab — any session that stopped heartbeating for over 5 minutes without a clean exit is reported to Sentry with its final samples. Browser tab discards (document.wasDiscarded) are reported as a separate event. Native platforms get a no-op.Fixed Issues
$ #93916
PROPOSAL:
Tests
To verify this you need to put website into browser's OOM crash
Offline tests
N/A
QA Steps
Same as tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)Avatar, 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