[Performance] Drop dead NETWORK dependency from visibleReportActions derivation#88592
Conversation
|
@dukenv0307 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] |
|
@sobitneupane @rlinoz One of you needs to 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] |
|
🚧 @rlinoz has triggered a test Expensify/App build. You can view the workflow run here. |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d703026c66
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
d703026 to
06b9cdc
Compare
| // Session change = user changed, need full recompute due to whisper targeting | ||
| // Network change = online/offline status changed, need full recompute for DELETE action visibility | ||
| if (sessionUpdates || networkUpdates) { | ||
| if (sessionUpdates) { |
There was a problem hiding this comment.
we only store debug flags there as offline/online status is a completely transient piece of state
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / Safari |
|
Hey sorry @dukenv0307 we did need, and then we reverted the change that I was worried about here. No need anymore, thanks |
|
@codex review |
|
Codex Review: Didn't find any major issues. Chef's kiss. ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
|
🚧 @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! 🧪🧪
|
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
Explanation of Change
Headline (warm LHN → empty chat, 4 trials each):
OnyxDerivedCompute_visibleReportActionsspans: 1 → 0 per warm navReportActionsListsubscribers, fired on every API call that writestimeSkew(e.g.AuthenticatePusher, which fires on every report open).src/libs/actions/OnyxDerived/configs/visibleReportActions.tsdeclaredONYXKEYS.NETWORKas a dependency. The inline comment said "NETWORK is needed to recompute when online/offline status changes (for DELETE action visibility)". That made sense whenisOfflinelived in the OnyxNETWORKkey.After commit
7f67d3528f8("Make isOffline synchronous via NetworkState module-level state", March 2026),isOfflinewas moved into a transient in-memory module (src/libs/NetworkState.ts) and is no longer persisted to Onyx. The remaining OnyxNETWORKkey only holds debug flags (shouldForceOffline,shouldSimulatePoorConnection,shouldFailAllRequests) andtimeSkew.timeSkewis written bysrc/libs/HttpUtils.ts:86on every API response matchingaddSkewList— includingAuthenticatePusher, which fires on every report open. Each such write triggered a full cross-report recompute ofvisibleReportActions. But the compute function (shouldReportActionBeVisibleatsrc/libs/ReportActionsUtils.ts:1221-1325) doesn't readisOfflineanywhere — the DELETE-visibility logic it was originally gating on no longer lives there. The dep was vestigial.Fix: drop
ONYXKEYS.NETWORKfromdependencies, remove thenetworkUpdatesvariable and the|| networkUpdatesgate, update the stale comment.Fixed Issues
$
PROPOSAL:
Tests
Offline tests
QA Steps
Same as tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand 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
No UI change; see the span-count delta above.
Android: mWeb Chrome
No UI change; see the span-count delta above.
iOS: Native
No UI change; see the span-count delta above.
iOS: mWeb Safari
No UI change; see the span-count delta above.
MacOS: Chrome / Safari
No UI change; see the span-count delta above.