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-10-01] Reports - Add existing expense to report doesn't work #102003
Version Number: 9.4.92-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:https://test-management.browserstack.com/projects/2219752/folder/57605190/test-cases/41237114 Email or phone of affected tester (no customers):gatantm+967@gmail.com Issue reported by: Applause Internal Team Bug source: Regression TC Execution Device used: iPhone 12 mini, iOS 16.7 App Component: Money Requests
Action Performed:
Launch new Expensify logged in with an account with unreported expenses
Tap on Fab > Create new report
Tap on Add expense > Add existing expense
Tap and hold on any of the expenses and tap Select
Expected Result:
When going to Add existing expense the expenses on draft reports or you are shown with multi select enabled
Actual Result:
When going to Add existing expense the expenses on draft reports or you are shown but multi select is not enabled. Trying to enable it by tapping and holding on an expense and tapping Select does nothing most of the times
👋 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.
#100886 migrated Add existing expense from SelectionList canSelectMultiple (checkboxes always visible) to the shared Table component, which on small screens hides selection until the app‑global mobile selection mode is turned on — so multi‑select is no longer enabled by default on iOS/Android, which is exactly the expected result in the failing TC. The PR is self‑contained (the old SelectionList path and UnreportedExpenseListItem still exist, and nothing merged after it touches these files), so a revert is clean.
Assigned: @Krishna2323 (PR author), @JS00001 and @situchan (approving reviewers) from highest-confidence causing PR only Labels: No changes. DeployBlockerCash is kept (App PR caused it, App deploy stays blocked). DeployBlocker was not present, so nothing was removed.
📋 Detailed Analysis
Evidence
Reproducible on staging (9.4.92-0) only, not production — consistent with a PR in the current checklist.
Every commit that currently touches the Add existing expense screen and the Table selection code on staging comes from that PR's branch (krishna2323/table-add-existing-expense-100589): 666fafddf, 29ac9fb49 ("fix: mobile selection mode … in Add existing expense"), e296c8715, e6f1d8451, 37173ffe5, 6a35679ce. No other checklist PR touches this path.
The PR itself already contains a partial fix for this exact symptom — commit 37173ffe5, "fix: only let the report header turn off the shared selection mode when focused" — which is direct evidence the author hit "Select does nothing" while building this.
Behaviour change (the deterministic half of the bug):
Why "Select does nothing most of the times" (the flaky half):
Table drives the app‑global ONYXKEYS.RAM_ONLY_MOBILE_SELECTION_MODE flag, and it writes it asynchronously via Onyx.merge inside a useLayoutEffect that closes the bottom‑docked modal in the same tick (Table.tsx#L455-L463, Table.tsx#L287-L294). Several other mounted consumers can immediately flip that same flag back off:
MoneyReportHeader.tsx#L102-L109 calls turnOffMobileSelectionMode()during render whenever the report has ≤1 visible transaction — always true for the brand‑new report the repro creates via FAB > Create new report. The PR added an isFocused guard here, which narrows but doesn't remove the shared‑state hazard.
Native‑only fits: the "Select" handler takes an iOS‑only branch (Table.tsx#L443-L448 — getPlatform() returns web/mobileWeb on mWeb), and the deferred onModalHide reset (Table.tsx#L541-L549) is animation‑timed on native, which widens the window for another writer to win the race.
gh api "repos/Expensify/App/commits?path=<file>&sha=staging" shows this PR's branch as the only source of recent changes to each of them, and gh pr view 100886 --json files confirms all of them are in the PR.
Root Cause
The migration replaced an always‑multi‑select list with the shared Table, whose small‑screen selection is gated behind a single app‑global Onyx flag (RAM_ONLY_MOBILE_SELECTION_MODE). Two consequences:
Multi‑select is no longer on by default on narrow native layouts, so the screen opens without checkboxes and row taps do nothing — the reported "multi select is not enabled".
Turning it on via long‑press → Select is an async Onyx.merge into globally shared state that other mounted screens (notably the underlying, nearly empty report header) also write, so the flag frequently gets cleared right after it is set — the reported "does nothing most of the times".
💡 Suggested AI code review rule
This bug leans on a recurring, mechanically detectable pattern, so it may be worth a coding-standards rule so the AI reviewer catches the next one. Proposed for Expensify/App (.claude/skills/app-coding-standards):
Rule:CLEAN-REACT-PATTERNS-10 — Never write Onyx state during render
Condition: Flag a call to an Onyx-writing action (Onyx.merge/Onyx.set/Onyx.update, or a @userActions/@libs/actions helper that wraps one, e.g. turnOffMobileSelectionMode()) that sits directly in a component body rather than in a useEffect/useLayoutEffect or an event handler. Move it into an effect or a handler, or derive the value instead of storing it.
Why: A render-phase Onyx write is a side effect on shared global state that runs on every render of every mounted instance, including background screens, so it silently clobbers state another screen just set, and the failure is timing-dependent and platform-specific. That is what makes long-press → "Select" fail intermittently here.
Search pattern:rg -n '^\s{4,8}(Onyx\.(merge|set|update)|turn(On|Off)[A-Za-z]+|set[A-Z][A-Za-z]*Onyx)\(' src/**/*.tsx then discard hits whose nearest enclosing function is a useEffect/useLayoutEffect/handler. AST form: a CallExpression to an Onyx-writing callee whose nearest enclosing function is the component function itself.
Fix (✅): move that turnOffMobileSelectionMode() into a useEffect keyed on [isMobileSelectionModeEnabled, shouldUseNarrowLayout, isFocused, visibleTransactions.length]; the PR's isFocused guard only narrows the window instead of removing the render-phase write.
Note the related event-in-effect shape in Table.tsx#L438-L463 (press handler sets state, a useLayoutEffect performs the action) is already covered by the existing PERF-8 — Handle events in handlers, so no new rule is proposed for it.
The full rule file, with the ❌/✅ code inline in the App coding-standards format, would go in Expensify/App itself. If it's worth adding, a maintainer can open it there as a draft PR.
Short version:feat: use Table component for Add existing expense flow swapped Add existing expense from SelectionList canSelectMultiple (checkboxes always visible) to the shared Table, which hides selection on small screens until the app-global mobile selection mode flag is on — and that flag gets clobbered by other mounted screens, so long-press → Select often does nothing. Recommendation: revert, the PR is self-contained and the old SelectionList path still exists.
One caveat: I could not verify this in a browser or on a device in this run — browser control was unavailable, and the bug is native-only (iOS/Android app) anyway, so web wouldn't have reproduced it. The analysis is from code and git history alone. Someone should confirm the repro on a native build before the revert lands.
Next Steps: Reply with @MelvinBot <your feedback> to refine this analysis.
This was working at the time of C+ approval.
Looks like 37173ff (later commit after my approval) caused this while addressing Jack's feedback before merge.
If you think the engineer's requested changes is risky after C+ approval, feel free to ask C+ for retest before merge.
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.4.92-8 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-10-01. 🎊
The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the Contributor+ 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]. If no checklist is needed for this issue, you can click: [no checklist button]
Activity
applause-bot commentedon Sep 23, 2026
While Applause doesn't embed attachments for this bug, here are the links for quick view:
https://platform.applause.com/services/links/v1/external/ecf1995f188e150253d985b8bf9399fa9999bc0c9fcd91c36a85bc8638726278
github-actions commentedon Sep 23, 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:
melvin-bot commentedon Sep 23, 2026
Triggered auto assignment to @rlinoz (
DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.melvin-bot commentedon Sep 23, 2026
💬 A slack conversation has been started in #expensify-open-source
MelvinBot commentedon Sep 23, 2026
🔍 Investigation Summary
Classification: Frontend bug
Causing PR: feat: use Table component for Add existing expense flow - "feat: use Table component for Add existing expense flow" by @Krishna2323 (High confidence)
Related Issues: Deploy Checklist: New Expensify 2026-09-23
Recommendation: REVERT
#100886 migrated Add existing expense from
SelectionList canSelectMultiple(checkboxes always visible) to the sharedTablecomponent, which on small screens hides selection until the app‑global mobile selection mode is turned on — so multi‑select is no longer enabled by default on iOS/Android, which is exactly the expected result in the failing TC. The PR is self‑contained (the oldSelectionListpath andUnreportedExpenseListItemstill exist, and nothing merged after it touches these files), so a revert is clean.Assigned: @Krishna2323 (PR author), @JS00001 and @situchan (approving reviewers) from highest-confidence causing PR only
Labels: No changes.
DeployBlockerCashis kept (App PR caused it, App deploy stays blocked).DeployBlockerwas not present, so nothing was removed.📋 Detailed Analysis
Evidence
9.4.92-0) only, not production — consistent with a PR in the current checklist.2026-09-22T16:28:32Z, ~15h before this was reported.Tableselection code onstagingcomes from that PR's branch (krishna2323/table-add-existing-expense-100589):666fafddf,29ac9fb49("fix: mobile selection mode … in Add existing expense"),e296c8715,e6f1d8451,37173ffe5,6a35679ce. No other checklist PR touches this path.37173ffe5, "fix: only let the report header turn off the shared selection mode when focused" — which is direct evidence the author hit "Select does nothing" while building this.Behaviour change (the deterministic half of the bug):
Production renders
<SelectionList … canSelectMultiple>, so checkboxes are visible immediately on every platform.On staging, the row is only a selection target once mobile selection mode is on:
AddExistingExpenseTableRow.tsx#L52-L59returns early whenisSmallScreenWidth, and the checkbox column is gated byTableRow.tsx#L111:Why "Select does nothing most of the times" (the flaky half):
Tabledrives the app‑globalONYXKEYS.RAM_ONLY_MOBILE_SELECTION_MODEflag, and it writes it asynchronously viaOnyx.mergeinside auseLayoutEffectthat closes the bottom‑docked modal in the same tick (Table.tsx#L455-L463,Table.tsx#L287-L294). Several other mounted consumers can immediately flip that same flag back off:MoneyReportHeader.tsx#L102-L109callsturnOffMobileSelectionMode()during render whenever the report has ≤1 visible transaction — always true for the brand‑new report the repro creates via FAB > Create new report. The PR added anisFocusedguard here, which narrows but doesn't remove the shared‑state hazard.useMobileSelectionMode.ts#L15-L21turns the flag off on mount of any consumer that mounts while it is on, anduseHandleSelectionMode.ts#L40/MoneyReportHeader.tsx#L96-L100turn it off unconditionally on unmount.Native‑only fits: the "Select" handler takes an iOS‑only branch (
Table.tsx#L443-L448—getPlatform()returnsweb/mobileWebon mWeb), and the deferredonModalHidereset (Table.tsx#L541-L549) is animation‑timed on native, which widens the window for another writer to win the race.Verification
Affected files, all modified by #100886:
src/pages/AddExistingExpense.tsxSelectionListtoTablesrc/components/Tables/AddExistingExpenseTable/index.tsx+AddExistingExpenseTableRow.tsxsrc/components/Table/Table.tsxsetMobileSelectionModeEnabledsrc/components/Table/middlewares/selection.tssrc/components/MoneyReportHeader.tsxisFocusedfix for this exact symptomgh api "repos/Expensify/App/commits?path=<file>&sha=staging"shows this PR's branch as the only source of recent changes to each of them, andgh pr view 100886 --json filesconfirms all of them are in the PR.Root Cause
The migration replaced an always‑multi‑select list with the shared
Table, whose small‑screen selection is gated behind a single app‑global Onyx flag (RAM_ONLY_MOBILE_SELECTION_MODE). Two consequences:Onyx.mergeinto globally shared state that other mounted screens (notably the underlying, nearly empty report header) also write, so the flag frequently gets cleared right after it is set — the reported "does nothing most of the times".💡 Suggested AI code review rule
This bug leans on a recurring, mechanically detectable pattern, so it may be worth a coding-standards rule so the AI reviewer catches the next one. Proposed for
Expensify/App(.claude/skills/app-coding-standards):CLEAN-REACT-PATTERNS-10— Never write Onyx state during renderOnyx.merge/Onyx.set/Onyx.update, or a@userActions/@libs/actionshelper that wraps one, e.g.turnOffMobileSelectionMode()) that sits directly in a component body rather than in auseEffect/useLayoutEffector an event handler. Move it into an effect or a handler, or derive the value instead of storing it.rg -n '^\s{4,8}(Onyx\.(merge|set|update)|turn(On|Off)[A-Za-z]+|set[A-Z][A-Za-z]*Onyx)\(' src/**/*.tsxthen discard hits whose nearest enclosing function is auseEffect/useLayoutEffect/handler. AST form: aCallExpressionto an Onyx-writing callee whose nearest enclosing function is the component function itself.src/components/MoneyReportHeader.tsx#L102-L109turnOffMobileSelectionMode()into auseEffectkeyed on[isMobileSelectionModeEnabled, shouldUseNarrowLayout, isFocused, visibleTransactions.length]; the PR'sisFocusedguard only narrows the window instead of removing the render-phase write.Note the related event-in-effect shape in
Table.tsx#L438-L463(press handler sets state, auseLayoutEffectperforms the action) is already covered by the existingPERF-8— Handle events in handlers, so no new rule is proposed for it.The full rule file, with the ❌/✅ code inline in the App coding-standards format, would go in
Expensify/Appitself. If it's worth adding, a maintainer can open it there as a draft PR.MelvinBot commentedon Sep 23, 2026
🤖 Investigation complete — see my analysis above.
Short version: feat: use Table component for Add existing expense flow swapped Add existing expense from
SelectionList canSelectMultiple(checkboxes always visible) to the sharedTable, which hides selection on small screens until the app-global mobile selection mode flag is on — and that flag gets clobbered by other mounted screens, so long-press → Select often does nothing. Recommendation: revert, the PR is self-contained and the oldSelectionListpath still exists.One caveat: I could not verify this in a browser or on a device in this run — browser control was unavailable, and the bug is native-only (iOS/Android app) anyway, so web wouldn't have reproduced it. The analysis is from code and git history alone. Someone should confirm the repro on a native build before the revert lands.
Next Steps: Reply with
@MelvinBot <your feedback>to refine this analysis.view run
melvin-bot commentedon Sep 23, 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.
situchan commentedon Sep 23, 2026
This was working at the time of C+ approval.
Looks like 37173ff (later commit after my approval) caused this while addressing Jack's feedback before merge.
If you think the engineer's requested changes is risky after C+ approval, feel free to ask C+ for retest before merge.
melvin-bot commentedon Sep 23, 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.
m-natarajan commentedon Sep 23, 2026
Xiaomi Redmi Note 10 / Android 12
ap 9.4.92-2
Passed
Screenrecorder-2026-09-23-15-40-13-382.mp4
[-]Reports - Add existing expense to report doesn't work[/-][+][Due for payment 2026-10-01] Reports - Add existing expense to report doesn't work[/+]melvin-bot commentedon Sep 24, 2026
@Krishna2323 / @situchan
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.4.92-8 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-10-01. 🎊
The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the Contributor+ 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]. If no checklist is needed for this issue, you can click: [no checklist button]