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 2025-11-13] [$250] Report - "Outstanding" seen as status when cancelling payment offline with approvals disabled #72750
Prerequisite: Account has at least one workspace.
Prerequisite 2: Delayed submissions enabled and approvals disabled.
Open the Expensify app.
Open any workspace chat.
Create a manual expense.
Tap on "Submit" on expense preview.
Note that status changes to "Done".
Mark expense as paid.
Turn off internet connection.
Open the expense report.
Tap on "More" and cancel the payment.
Note that status changes from "Paid" to "Outstanding" instead of returning to "Done".
Expected Result:
When payment of an expense is cancelled, status should change to "Done" instead of "Outstanding" if approvals are disabled.
Actual Result:
When payment of an expense is cancelled while in offline mode, status changes from "Paid" to "Outstanding" instead of returning to "Done" if approvals are disabled.
🚨 Edited by proposal-police: This proposal was edited at 2025-10-27 18:18:33 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
When payment of an expense is cancelled while in offline mode, status changes from "Paid" to "Outstanding" instead of returning to "Done" if approvals are disabled.
What is the root cause of that problem?
PR #56950 fixed the disappearing delete button (#55319) by keeping reports as SUBMITTED/SUBMITTED after payment cancellation. However, this causes #72750: the report incorrectly shows "Outstanding" (awaiting approval) even when approvals are disabled.
Root cause: The status logic can't distinguish between:
SUBMITTED/SUBMITTED genuinely awaiting approval → should show "Outstanding"
SUBMITTED/SUBMITTED from a cancelled payment with no approvals → should show "Done"
The conflict:
Setting the state to APPROVED/CLOSED after cancellation shows the correct status, but breaks the delete button (only works in OPEN/PROCESSING states)
Setting the state to SUBMITTED/SUBMITTED preserves the delete button but displays the wrong status
What changes do you think we should make in order to solve the problem?
Solution 1
Update getReportStatusTranslation() to accept an optional isCancelledIOU & approvalMode parameters, we can also update getReportStatusColorStyle()
if(stateNum===CONST.REPORT.STATE_NUM.SUBMITTED&&statusNum===CONST.REPORT.STATUS_NUM.SUBMITTED){// If payment was cancelled and approvals are disabled (OPTIONAL mode), show "Done" instead of "Outstanding"// For BASIC/ADVANCED modes, the report should still show "Outstanding" even after cancellation since it needs approvalif(isCancelledIOU&&approvalMode===CONST.POLICY.APPROVAL_MODE.OPTIONAL){// eslint-disable-next-line @typescript-eslint/no-deprecatedreturntranslateLocal('common.done');}// eslint-disable-next-line @typescript-eslint/no-deprecatedreturntranslateLocal('common.outstanding');}
In canDeleteMoneyRequestReport() (ReportUtils.ts): Add an exception to allow deletion from APPROVED/CLOSED state only when the policy has OPTIONAL approval mode enabled (no approvals required)
// Allow deletion if report is open/processing, or if it's an APPROVED/CLOSED report with OPTIONAL approval mode (cancelled payment)constisOptionalApprovalCancelled=report.stateNum===CONST.REPORT.STATE_NUM.APPROVED&&report.statusNum===CONST.REPORT.STATUS_NUM.CLOSED&&policy?.approvalMode===CONST.POLICY.APPROVAL_MODE.OPTIONAL;returnisReportSubmitter&&(isReportOpenOrProcessing||isOptionalApprovalCancelled)&&!isForwarded;
What alternative solutions did you explore? (Optional)
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.
When approvals are disabled (OPTIONAL), the report is set to stateNum = SUBMITTED and statusNum = SUBMITTED, which according to getReportStatusTranslation displays as "Outstanding"
However, when approvals are disabled, the expected behavior is that cancelled payments should show "Done" status, which corresponds to stateNum = APPROVED and statusNum = CLOSED:
The problem is that the logic treats OPTIONAL (disabled approvals) the same as if the report was just submitted, rather than treating it as a completed report
What changes do you think we should make in order to solve the problem?
Change the logic in cancelPayment to set the correct state and status for reports with disabled approvals. When approvals are disabled, cancelling payment should result in "Done" status (APPROVED/CLOSED), not "Outstanding" status (SUBMITTED/SUBMITTED)
changed the title [-]Report - "Outstanding" seen as status when cancelling payment offline with approvals disabled[/-][+][$250] Report - "Outstanding" seen as status when cancelling payment offline with approvals disabled[/+]on Oct 22, 2025
[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: It looks like the backend logic has been updated, so the frontend needs to be updated accordingly to match it.
[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.
Regression Test Proposal
Precondition:
Account has at least one workspace.
Workspace with delayed submissions enabled and approvals disabled
Test:
Create a manual expense in the workspace
Submit the expense - verify status shows "Done"
Mark the expense as paid - verify status shows "Paid"
Turn off internet connection (enable airplane mode)
Open the expense report header
Tap on "More" menu and select "Cancel payment"
Verify status changes from "Paid" to "Done" (NOT "Outstanding")
Activity
melvin-bot commentedon Oct 16, 2025
Triggered auto assignment to @strepanier03 (
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.mohammadjafarinejad commentedon Oct 16, 2025
🚨 Edited by proposal-police: This proposal was edited at 2025-10-27 18:18:33 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
When payment of an expense is cancelled while in offline mode, status changes from "Paid" to "Outstanding" instead of returning to "Done" if approvals are disabled.
What is the root cause of that problem?
PR #56950 fixed the disappearing delete button (#55319) by keeping reports as
SUBMITTED/SUBMITTEDafter payment cancellation. However, this causes #72750: the report incorrectly shows "Outstanding" (awaiting approval) even when approvals are disabled.Root cause: The status logic can't distinguish between:
SUBMITTED/SUBMITTEDgenuinely awaiting approval → should show "Outstanding"SUBMITTED/SUBMITTEDfrom a cancelled payment with no approvals → should show "Done"The conflict:
Setting the state to
APPROVED/CLOSEDafter cancellation shows the correct status, but breaks the delete button (only works inOPEN/PROCESSINGstates)Setting the state to
SUBMITTED/SUBMITTEDpreserves the delete button but displays the wrong statusApp/src/libs/actions/IOU.ts
Lines 10833 to 10834 in b1a71fc
What changes do you think we should make in order to solve the problem?
Solution 1
Update
getReportStatusTranslation()to accept an optionalisCancelledIOU&approvalModeparameters, we can also updategetReportStatusColorStyle()App/src/libs/ReportUtils.ts
Lines 12036 to 12038 in e6da175
Solution 2
cancelPayment()(IOU.ts): Set state toAPPROVED/CLOSEDfor OPTIONAL approval mode.canDeleteMoneyRequestReport()(ReportUtils.ts): Add an exception to allow deletion fromAPPROVED/CLOSEDstate only when the policy has OPTIONAL approval mode enabled (no approvals required)App/src/libs/ReportUtils.ts
Lines 2758 to 2762 in e6da175
What alternative solutions did you explore? (Optional)
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.
nyomanjyotisa commentedon Oct 16, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
Report - "Outstanding" seen as status when cancelling payment offline with approvals disabled
What is the root cause of that problem?
When determining the state and status after cancelling payment, the code uses this logic:
App/src/libs/actions/IOU.ts
Lines 10845 to 10847 in 825fb54
When approvals are disabled (
OPTIONAL), the report is set tostateNum = SUBMITTEDandstatusNum = SUBMITTED, which according togetReportStatusTranslationdisplays as "Outstanding"App/src/libs/ReportUtils.ts
Lines 11964 to 11966 in 825fb54
However, when approvals are disabled, the expected behavior is that cancelled payments should show "Done" status, which corresponds to
stateNum = APPROVEDandstatusNum = CLOSED:App/src/libs/ReportUtils.ts
Lines 11967 to 11969 in 825fb54
The problem is that the logic treats
OPTIONAL(disabled approvals) the same as if the report was just submitted, rather than treating it as a completed reportWhat changes do you think we should make in order to solve the problem?
Change the logic in
cancelPaymentto set the correct state and status for reports with disabled approvals. When approvals are disabled, cancelling payment should result in "Done" status (APPROVED/CLOSED), not "Outstanding" status (SUBMITTED/SUBMITTED)App/src/libs/actions/IOU.ts
Lines 10846 to 10847 in 825fb54
What alternative solutions did you explore? (Optional)
None
[-]Report - "Outstanding" seen as status when cancelling payment offline with approvals disabled[/-][+][$250] Report - "Outstanding" seen as status when cancelling payment offline with approvals disabled[/+]melvin-bot commentedon Oct 22, 2025
Job added to Upwork: https://www.upwork.com/jobs/~021981145445472469112
melvin-bot commentedon Oct 22, 2025
Triggered auto assignment to Contributor-plus team member for initial proposal review - @suneox (
External)strepanier03 commentedon Oct 22, 2025
Reproducible pretty easily.
31 remaining items
strepanier03 commentedon Nov 13, 2025
Payment summary
For: #73936
strepanier03 commentedon Nov 13, 2025
@suneox - I'll take the hold off the payment summary after I make the reg test, thanks!
strepanier03 commentedon Nov 17, 2025
Friendly bump on the checklist @suneox
suneox commentedon Nov 20, 2025
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: It looks like the backend logic has been updated, so the frontend needs to be updated accordingly to match it.
[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.
Regression Test Proposal
Precondition:
Test:
Do we agree 👍 or 👎
strepanier03 commentedon Nov 21, 2025
Thanks @suneox - I removed the hold from the payment summary so go ahead and request if you haven't already.
garrettmknight commentedon Dec 7, 2025
$250 approved for @suneox
Keep optimistic statusNum as CLOSED for OPTIONAL approval mode, fix n…