Coalesce OnyxDerived recomputations via microtask scheduling#96785
Open
fabioh8010 wants to merge 5 commits into
Open
Coalesce OnyxDerived recomputations via microtask scheduling#96785fabioh8010 wants to merge 5 commits into
fabioh8010 wants to merge 5 commits into
Conversation
This reverts commit 4c28035.
fabioh8010
marked this pull request as ready for review
July 22, 2026 20:52
melvin-bot
Bot
requested review from
JmillsExpensify,
abzokhattab and
shubham1206agra
and removed request for
a team
July 22, 2026 20:52
|
@shubham1206agra @abzokhattab 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] |
7 tasks
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.
|
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
Re-lands the OnyxDerived recompute coalescing (originally #95287, reverted in #95715), with the
derived-value flush moved from a macrotask to a microtask (
queueMicrotask, inlined insrc/libs/actions/OnyxDerived/index.ts).Coalescing batches the multiple dependency changes delivered in one synchronous Onyx broadcast burst
into a single recompute — preserving the startup/send perf win (send latency ~177ms → ~84ms, ~53%
faster; derived recomputes 51 → 20;
reportAttributescomputes 11 → 5). Flushing on a microtask(instead of the previously-reverted macrotask) drains the recompute at the end of the current task,
before React's next render/paint, so raw Onyx data and derived data stay consistent within a
render. That closes the stale-frame / stale-read window that caused the five deploy blockers below.
Also merges latest
mainand reconcilesreportAttributes/visibleReportActionswith thecoalescing engine's
triggeredKeyscontract (includingmain'sRECOMPUTE_ALLnarrowing andsession/whisper
currentUserAccountIDtargeting).Fixed Issues
$ #95301
$ #95696
$ #95698
$ #95700
$ #95721
$ #95753
PROPOSAL: N/A
Tests
Deploy Blockers
Misc
Offline tests
N/A
QA Steps
Same as Tests.
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
Screen.Recording.2026-07-22.at.20.16.42-compressed.mov
Screen.Recording.2026-07-22.at.21.40.40-compressed.mov
iOS: mWeb Safari
MacOS: Chrome / Safari
Screen.Recording.2026-07-22.at.17.04.22-compressed.mov
Screen.Recording.2026-07-22.at.17.17.13-compressed.mov