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-01-12] [$250] Expense - "Submit" changes to "Approve" on preview when online after partially approve offline #76780
Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor
Version Number: 9.2.72-0 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught during regression testing, add the test name, ID and link from BrowserStack:#74541 Email or phone of affected tester (no customers):ibellicotest+2154@gmail.com Issue reported by: Applause Internal Team Device used: Motorola MotoG60 / Android 12 / Chrome (mWeb / Hybrid app) - Windows 11 / Chrome App Component: Money Requests
Action Performed:
Prerequisite: Account has at least one workspace.
Open the Expensify app.
Open any workspace chat.
Create two manual expenses.
Open the report.
Long tap and select one of the expenses.
Tap on dropdown menu and select "Hold"
Enter any reason and hold the expense.
Return to chat.
Tap on "Submit" on report preview.
Turn off internet connection.
Tap on "Approve"
Approve only the unheld amount.
Note that held expense is moved to a new report and shows a "Submit" button on preview.
Turn on internet connection.
Note that "Submit" button changes to "Approve".
Expected Result:
After partially approving report offline, preview of held expense should automatically display an "Approve" button.
Actual Result:
After partially approving a report while offline, preview of held expense shows a "Submit" button, that changes to "Approve" when back online.
Please re-state the problem that we are trying to solve in this issue.
Expense - "Submit" changes to "Approve" on preview when online after partially approve offline
What is the root cause of that problem?
When partially approving a report offline (approving only the unheld amount), a new expense report is created for the held transactions using getReportFromHoldRequestsOnyxData. This function then calls buildOptimisticExpenseReport which determines the report stateNum and statusNum
However, the held transactions were already part of a submitted (processing) report. When they're moved to a new report during partial approval, that new report should maintain the SUBMITTED/SUBMITTED (Processing) state so that the "Approve" button shows, not "Submit"
canApprove function requires the report to be in processing state (isProcessingReport) to show "Approve"
What changes do you think we should make in order to solve the problem?
In getReportFromHoldRequestsOnyxData, when adding the optimistic expense report for held transactions, we should override the stateNum and statusNum to SUBMITTED to ensure the report is in processing state and shows "Approve" button
changed the title [-]Expense - "Submit" changes to "Approve" on preview when online after partially approve offline[/-][+][$250] Expense - "Submit" changes to "Approve" on preview when online after partially approve offline[/+]on Dec 5, 2025
What alternative solutions did you explore? (Optional)
We can pass newStateNum and newStatusNum param to getReportFromHoldRequestsOnyxData function when approving/paying partially. Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
⚠️@nkdengineer Your proposal is a duplicate of an already existing proposal and has been automatically withdrawn to prevent spam. Please review the existing proposals before submitting a new one.
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.2.92-1 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
@situchan@jliexpensify 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]
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion: N/A
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
@situchan This is regarding the regression test proposal.
Is the submit flow for a report with an expense on hold changed?
Pay only the unheld amount not displayed and new report created for the held expense when report is submitted
Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor
Activity
melvin-bot commentedon Dec 4, 2025
Triggered auto assignment to @jliexpensify (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.nyomanjyotisa commentedon Dec 4, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
Expense - "Submit" changes to "Approve" on preview when online after partially approve offline
What is the root cause of that problem?
When partially approving a report offline (approving only the unheld amount), a new expense report is created for the held transactions using
getReportFromHoldRequestsOnyxData. This function then callsbuildOptimisticExpenseReportwhich determines the reportstateNumandstatusNumApp/src/libs/ReportUtils.ts
Line 6837 in 666a8b0
The issue is that
getExpenseReportStateAndStatusreturnsOPEN/OPENwhen instant submit is not enabledApp/src/libs/ReportUtils.ts
Lines 6797 to 6800 in 666a8b0
However, the held transactions were already part of a submitted (processing) report. When they're moved to a new report during partial approval, that new report should maintain the
SUBMITTED/SUBMITTED(Processing) state so that the "Approve" button shows, not "Submit"canApprovefunction requires the report to be in processing state (isProcessingReport) to show "Approve"App/src/libs/ReportPreviewActionUtils.ts
Lines 50 to 74 in 666a8b0
And
isProcessingReportchecks forstateNum === SUBMITTED && statusNum === SUBMITTED:App/src/libs/ReportUtils.ts
Lines 1948 to 1950 in 666a8b0
What changes do you think we should make in order to solve the problem?
In
getReportFromHoldRequestsOnyxData, when adding the optimistic expense report for held transactions, we should override thestateNumandstatusNumtoSUBMITTEDto ensure the report is in processing state and shows "Approve" buttonApp/src/libs/actions/IOU.ts
Lines 9965 to 9973 in 666a8b0
or preserve the original report's state
What alternative solutions did you explore? (Optional)
None
[-]Expense - "Submit" changes to "Approve" on preview when online after partially approve offline[/-][+][$250] Expense - "Submit" changes to "Approve" on preview when online after partially approve offline[/+]melvin-bot commentedon Dec 5, 2025
Job added to Upwork: https://www.upwork.com/jobs/~021996731646343908370
melvin-bot commentedon Dec 5, 2025
Triggered auto assignment to Contributor-plus team member for initial proposal review - @situchan (
External)nkdengineer commentedon Dec 5, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
After partially approving a report while offline, preview of held expense shows a "Submit" button, that changes to "Approve" when back online.
What is the root cause of that problem?
The new report is created with the default
stateNumandstatusNum. It doesn't check the current status of the iouReport.App/src/libs/ReportUtils.ts
Line 6837 in 666a8b0
App/src/libs/actions/IOU.ts
Lines 9873 to 9875 in 666a8b0
What changes do you think we should make in order to solve the problem?
The behavior from the backend is
App/src/libs/ReportUtils.ts
Line 6837 in 666a8b0
App/src/libs/actions/IOU.ts
Lines 9873 to 9875 in 666a8b0
So we should do the same with the optimistic data, only update the new report as a processing report if the current report is being approved.
App/src/libs/actions/IOU.ts
Lines 9965 to 9973 in 666a8b0
What alternative solutions did you explore? (Optional)
We can pass
newStateNumandnewStatusNumparam togetReportFromHoldRequestsOnyxDatafunction when approving/paying partially.Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
github-actions commentedon Dec 5, 2025
situchan commentedon Dec 5, 2025
@nkdengineer have you found any issue with this solution?
I don't see the case of "Pay the report partially, the new report is a draft report"
nkdengineer commentedon Dec 5, 2025
@situchan You can try these steps
Approval, enable payment.22 remaining items
melvin-bot commentedon Jan 5, 2026
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Jan 5, 2026
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.2.92-1 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-01-12. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Jan 5, 2026
@situchan @jliexpensify 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]
jliexpensify commentedon Jan 6, 2026
Assigning @kadiealexander to help with payments/checklist while I'm OOO
Payment Summary
situchan commentedon Jan 6, 2026
I already accepted this offer and requested payment on upwork.
kadiealexander commentedon Jan 11, 2026
@situchan could you please complete the checklist?
situchan commentedon Jan 12, 2026
BugZero Checklist:
[Contributor] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
Link to comment: https://github.com/Expensify/App/pull/42573/changes#r2680759044
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion: N/A
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Link to issue: https://github.com/Expensify/Expensify/issues/587743
Regression Test Proposal
Test:
Case 1: Approve partial
Case 2: Pay partial
Precondition: Approval is disabled, payment is enabled
Do we agree 👍 or 👎
Zapier Logs
Run ID: 00040eee-85e1-af16-867b-e22f42062ad4twisterdotcom commentedon Jan 12, 2026
@nkdengineer has submitted payment for this report on ND here.
SO: https://stackoverflowteams.com/c/expensify/questions/7582
Zapier Logs
Run ID: 00040eee-4ef7-a88c-8bbe-cf1949b3f3f4m-natarajan commentedon Jun 18, 2026
@situchan This is regarding the regression test proposal.
Is the submit flow for a report with an expense on hold changed?
Pay only the unheld amount not displayed and new report created for the held expense when report is submitted
Recording.3042.mp4