fix: cancel all active telemetry spans on app background#81075
fix: cancel all active telemetry spans on app background#81075rlinoz merged 2 commits intoExpensify:mainfrom
Conversation
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.
|
|
@dominictb 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] |
| if (nextAppState.match(/inactive|background/) && appState === 'active') { | ||
| Log.info('Flushing logs as app is going inactive', true, {}, true); | ||
| saveCurrentPathBeforeBackground(); | ||
| cancelAllSpans(); |
There was a problem hiding this comment.
Specifically for web we are cancelling the spans when the user changes to another tab, and that is not ideal, as that is a common flow and the app is still loading in the background right?
Would it be possible to not cancel on tab change?
There was a problem hiding this comment.
There should be no spans running in the background thought as you're not actively interacting with the app. The JS thread can be throttled and that is something we simply want to discard regardless of the platform.
Unless, you can run into a really weird cancellation in a web build from this branch?
There was a problem hiding this comment.
The biggest span could be the app opening, and playing the devil's advocate I can imagine we can get very few spans being recorded if people have to wait 10s+ so they naturally switch between the apps.
That is still worth in my opinion, and we can later think of excluding this one metrics if it proves to be true.
|
No product considerations |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / Safari |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/rlinoz in version: 9.3.11-25 🚀
|
|
@adhorodyski @rlinoz @dominictb Could this one please be tested internally, QA team don't have access to sentry |
|
Hey @rlinoz, could you run internal QA please. I see you assigned to the checklist |
|
Yep |
|
So I think all good 😄 |
@rlinoz
Explanation of Change
cancelAllSpansfunction and exports itFixed Issues
$ #81073
PROPOSAL:
Tests
Offline tests
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
Same as tests.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, 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.ScrollViewcomponent to make it scrollable when more elements are added to the page.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