You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Due for payment 2026-04-23] Expense - Second expense does not auto appear in expense preview #87201
Version Number: 9.3.53-0 Reproducible in staging?: Yes Reproducible in production?: No If this was caught during regression testing, add the test name, ID and link from BrowserStack:#86636 Email or phone of affected tester (no customers):sjoinjojsodidsjodjso@gmail.com Issue reported by: Applause Internal Team Bug source: Exploratory - Significant User Experience Deterioration Device used: Mac 26.2 / Chrome App Component: Money Requests
Action Performed:
Go to staging.new.expensify.com
Go to workspace chat.
Create an expense.
Create another expense in the workspace chat.
Open another chat.
Go back to workspace chat.
Expected Result:
In Step 4, the second expense will auto appear in expense preview.
Actual Result:
In Step 4, the second expense does not auto appear in expense preview.
In Step 6, the second expense only appears in expense preview after navigating away and back.
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
Identify the pull request that introduced this issue and revert it.
The Onyx bump to 3.0.58 (PR #86636) introduced structural sharing in fastMerge and removeNestedNullValues. Previously, removeNestedNullValues always created a new object reference. Now it returns the original reference when no nulls are found.
The derived compute function in reportTransactionsAndViolations.tsmutates currentValue in place and returns the same object reference (lines ~32-85). When a second expense is created:
The compute function adds the new transaction to the existing currentValue object and returns it (same reference)
removeNestedNullValues sees no nulls, returns the same reference (new structural sharing behavior)
Onyx's keyChanged (OnyxUtils.js:549) checks lastConnectionCallbackData === value — since it's the same reference, it skips the subscriber callback entirely
useOnyx never fires, MoneyRequestReportPreview never re-renders, and the new expense doesn't appear
Other derived configs like sortedReportActions correctly create new references via spread ({...currentValue}), which is why only this specific data path is affected.
What changes do you think we should make in order to solve the problem?
In src/libs/actions/OnyxDerived/configs/reportTransactionsAndViolations.ts, the compute function should return a new top-level reference when the data has changed, rather than mutating and returning currentValue. This ensures Onyx's reference-equality checks detect the change and notify subscribers.
The pattern already exists in other derived configs — sortedReportActions.ts uses {...currentValue.sortedActions} to create fresh references.
What alternative solutions did you explore?
Revert the Onyx bump — would fix the issue but loses all structural sharing performance improvements.
Change Onyx's keyChanged to skip reference equality for skipCacheCheck keys — would work but is a broader change to Onyx internals and could mask other mutation bugs.
Create new reference in the compute function (recommended) — minimal, targeted fix that aligns with how other derived configs already work.
Supporting evidence
reportTransactionsAndViolations.ts:32 — const reportTransactionsAndViolations = currentValue ?? {}; reuses the same object when currentValue is truthy
reportTransactionsAndViolations.ts:79-85 — mutates the object in place: reportTransactionsAndViolations[reportID].transactions[transactionKey] = transaction
node_modules/react-native-onyx/dist/utils.js:122-148 — removeNestedNullValues returns value (not a new result) when no nulls found
node_modules/react-native-onyx/dist/OnyxUtils.js:549 — lastConnectionCallbackData.get(subscriber.subscriptionID) === value skips callback on reference match
Contrast with sortedReportActions.ts:48-50 which correctly spreads: const sortedActions = {...currentValue.sortedActions}
Possibly related issue:#87200 (deleted expense skeleton loader) may share the same root cause — the structural sharing change prevents re-renders when pendingAction: null is stripped by removeNestedNullValues, making the merge a no-op with no reference change.
Next Steps for Contributor+ team: Reply with @MelvinBot implement this to create a draft PR, @MelvinBot <your feedback> to refine this analysis, or explain why you are rejecting Melvin's proposal.
changed the title [-]Expense - Second expense does not auto appear in expense preview[/-][+][Due for payment 2026-04-23] Expense - Second expense does not auto appear in expense preview[/+]on Apr 16, 2026
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.3.59-4 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
@Julesssss The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]
Activity
melvin-bot commentedon Apr 7, 2026
You have been assigned to this deploy blocker because you recently merged this PR: #86636
melvin-bot commentedon Apr 7, 2026
💬 A slack conversation has been started in #expensify-open-source
github-actions commentedon Apr 7, 2026
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
MelvinBot commentedon Apr 7, 2026
Proposal
What is the root cause of that problem?
The Onyx bump to 3.0.58 (PR #86636) introduced structural sharing in
fastMergeandremoveNestedNullValues. Previously,removeNestedNullValuesalways created a new object reference. Now it returns the original reference when no nulls are found.The derived compute function in
reportTransactionsAndViolations.tsmutatescurrentValuein place and returns the same object reference (lines ~32-85). When a second expense is created:currentValueobject and returns it (same reference)removeNestedNullValuessees no nulls, returns the same reference (new structural sharing behavior)keyChanged(OnyxUtils.js:549) checkslastConnectionCallbackData === value— since it's the same reference, it skips the subscriber callback entirelyuseOnyxnever fires,MoneyRequestReportPreviewnever re-renders, and the new expense doesn't appearOther derived configs like
sortedReportActionscorrectly create new references via spread ({...currentValue}), which is why only this specific data path is affected.What changes do you think we should make in order to solve the problem?
In
src/libs/actions/OnyxDerived/configs/reportTransactionsAndViolations.ts, the compute function should return a new top-level reference when the data has changed, rather than mutating and returningcurrentValue. This ensures Onyx's reference-equality checks detect the change and notify subscribers.The pattern already exists in other derived configs —
sortedReportActions.tsuses{...currentValue.sortedActions}to create fresh references.What alternative solutions did you explore?
keyChangedto skip reference equality forskipCacheCheckkeys — would work but is a broader change to Onyx internals and could mask other mutation bugs.Supporting evidence
reportTransactionsAndViolations.ts:32—const reportTransactionsAndViolations = currentValue ?? {};reuses the same object whencurrentValueis truthyreportTransactionsAndViolations.ts:79-85— mutates the object in place:reportTransactionsAndViolations[reportID].transactions[transactionKey] = transactionnode_modules/react-native-onyx/dist/utils.js:122-148—removeNestedNullValuesreturnsvalue(not a newresult) when no nulls foundnode_modules/react-native-onyx/dist/OnyxUtils.js:549—lastConnectionCallbackData.get(subscriber.subscriptionID) === valueskips callback on reference matchsortedReportActions.ts:48-50which correctly spreads:const sortedActions = {...currentValue.sortedActions}Possibly related issue: #87200 (deleted expense skeleton loader) may share the same root cause — the structural sharing change prevents re-renders when
pendingAction: nullis stripped byremoveNestedNullValues, making the merge a no-op with no reference change.Next Steps for Contributor+ team: Reply with
@MelvinBot implement thisto create a draft PR,@MelvinBot <your feedback>to refine this analysis, or explain why you are rejecting Melvin's proposal.m-natarajan commentedon Apr 7, 2026
Dupe of #87179, Closing
melvin-bot commentedon Apr 7, 2026
If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.
If a regression has occurred and you are the assigned CM follow the instructions here.
If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.
[-]Expense - Second expense does not auto appear in expense preview[/-][+][Due for payment 2026-04-23] Expense - Second expense does not auto appear in expense preview[/+]melvin-bot commentedon Apr 16, 2026
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Apr 16, 2026
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.3.59-4 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2026-04-23. 🎊
melvin-bot commentedon Apr 16, 2026
@Julesssss The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]