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-05-29] [$250] Report - "Waiting for you to fix the issue" briefly visible after adding expense with receipt #89361
Version Number: 9.3.65-0 Reproducible in staging?: Yes Reproducible in production?: N/A - new feature, doesn't exist in prod If this was caught during regression testing, add the test name, ID and link from BrowserStack:#85225 Email or phone of affected tester (no customers):ibellicotest+2250@gmail.com Issue reported by: Applause Internal Team Bug source: Exploratory - Significant User Experience Deterioration Device used: Motorola MotoG60 / Android 12 (Hybrid app) - Windows 11 / Chrome App Component: Money Requests
Action Performed:
Prerequisite: Account has at least one workspace.
Open the staging.new.expensify.com website.
Open any workspace chat.
Create a manual expense.
Open the report of the just created expense.
Click on "Add a receipt" and add a receipt to expense.
Return to chat.
Create an empty report and open it.
Click on "Add Expense" > "Add existing expense"
Select the expense with receipt and add it to report.
Note that next step message on report shows "Waiting for you to fix the issue" briefly, despite no error being displayed.
Expected Result:
"Waiting for you to fix the issue" next step message, should not appear if added expense doesn´t have any violation or error.
Actual Result:
"Waiting for you to fix the issue" next step message is briefly visible after adding an existing expense with receipt to report. Message is displayed despite expense not having any violation or error.
👋 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.
Classification: Frontend bug Causing PR: #85225 - "Feat: Change Add unreported expense to Add existing expense in a report" by @nyomanjyotisa (High confidence) Related Issues: N/A
Recommendation: REVERT
PR #85225 is the clear cause of this staging-only regression. The bug is not present in production (the feature doesn't exist there yet), and the causing PR can be cleanly reverted.
Assigned: @nyomanjyotisa (PR author), @puneetlath (approving reviewer) Labels: DeployBlockerCash retained (Frontend bug — App PR caused the issue). DeployBlocker is not present and should not be added.
The bug involves the "Add existing expense" flow, which is exactly what PR Feat: Change Add unreported expense to Add existing expense in a report #85225 added/modified (it renamed "Add unreported expense" to "Add existing expense" and expanded the eligible transactions to include expenses from open draft reports, not just unreported ones).
The key behavioral change is in getEligibleTransactions: previously only transactions with reportID === CONST.REPORT.UNREPORTED_REPORT_ID || reportID === '' were eligible. PR Feat: Change Add unreported expense to Add existing expense in a report #85225 expanded this to also include transactions on any open expense report (using the new openExpenseReportIDsSelector).
The footer's handleConfirm calls changeTransactionsReport when moving expenses. That function, in section 9 ("Update next steps"), calls ViolationsUtils.getViolationsOnyxData for the moved transaction in the context of the destination report's policy.
When a receipt-bearing expense is moved from a draft/open report, the violation computation may produce violations (e.g., required fields not yet met in the destination report's policy context), setting shouldFixViolations = true.
This causes buildNextStepNew to optimistically generate a "Waiting for you to fix the issue" next step on the destination report. The message clears once the server responds with the correct state.
Root Cause
The violation-computation logic in changeTransactionsReport (lines 1152–1178 of src/libs/actions/Transaction.ts) runs ViolationsUtils.getViolationsOnyxData for each incoming transaction. For a draft-report expense being moved to a new report, this may produce violations optimistically (based on the destination policy's rules) and set shouldFixViolations = true. The resulting next-step computation then shows "Waiting for you to fix the issue" on the destination report's banner—even though the expense has no actual violations—until the server response clears the optimistic state.
This code path was never exercised before PR #85225 because the old "Add unreported expense" flow only allowed moving truly unreported transactions (with no reportID), which took a different branch in changeTransactionsReport (the isUnreported path that clears violations rather than computing them).
When adding an existing expense to a report via changeTransactionsReport, the client optimistically computes violations for the moved transaction using ViolationsUtils.getViolationsOnyxData. If the workspace policy requires categories or tags and the transaction doesn't have them set, policy violations like missingCategory are generated client-side. This sets shouldFixViolations = true in Transaction.ts:1178-1179, which causes buildOptimisticNextStep to produce a WAITING_TO_FIX_ISSUES next step at NextStepUtils.ts:131-137.
This optimistic next step is pushed to Onyx immediately, causing the "Waiting for you to fix the issues" message to render. When the server responds with the real next step (which doesn't include the fix-issues message since there are no actual blocking violations), the message disappears — producing the brief flash.
What changes do you think we should make in order to solve the problem?
The shouldFixViolations flag in changeTransactionsReport should not be set to true for policy violations like missingCategory or missingTag when the transaction is being moved via "Add existing expense". These violations are informational and don't warrant the "fix the issues" next step message.
Two possible approaches:
Filter out non-blocking violations when computing shouldFixViolations — only set it to true for violations that genuinely block submission (like SMARTSCAN_FAILED or NO_ROUTE), matching the logic already used in hasSubmissionBlockingViolations.
Skip the optimistic next step computation for the shouldFixViolations path when handling the "add existing expense" flow, since the server will compute the correct next step.
Approach 1 is preferred as it addresses the root cause and keeps optimistic updates accurate.
Investigation details
Data flow of the bug:
User selects existing expense with receipt → changeTransactionsReport() fires
Optimistic data pushed to Onyx → useOptimisticNextStep hook re-renders → flash appears
Server responds with correct next step → flash disappears
Key observation: The render-time path in getReportNextStep (NextStepUtils.ts:357-375) already correctly limits the "fix issues" check to only SMARTSCAN_FAILED and NO_ROUTE violations via hasSubmissionBlockingViolations. The optimistic path in changeTransactionsReport should follow the same pattern.
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.
@nabi-ebrahimi , can you please accept the job below? Please reply here and tag me once you have.
If you're not sent an offer in Upwork when you're assigned to an issue, and an Upwork job exists, please submit a proposal.
@nabi-ebrahimi , can you please accept the job below? Please reply here and tag me once you have. If you're not sent an offer in Upwork when you're assigned to an issue, and an Upwork job exists, please submit a proposal.
^ Test case created. Thx
@mallenexpensify, just to confirm, would you like me to submit a proposal for an Expensify Upwork job? Thx.
Activity
melvin-bot commentedon May 1, 2026
You have been assigned to this deploy blocker because you recently merged this PR: #85225
melvin-bot commentedon May 1, 2026
💬 A slack conversation has been started in #expensify-open-source
github-actions commentedon May 1, 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:
OSBotify commentedon May 1, 2026
Investigation Summary
Classification: Frontend bug
Causing PR: #85225 - "Feat: Change Add unreported expense to Add existing expense in a report" by @nyomanjyotisa (High confidence)
Related Issues: N/A
Recommendation: REVERT
PR #85225 is the clear cause of this staging-only regression. The bug is not present in production (the feature doesn't exist there yet), and the causing PR can be cleanly reverted.
Assigned: @nyomanjyotisa (PR author), @puneetlath (approving reviewer)
Labels:
DeployBlockerCashretained (Frontend bug — App PR caused the issue).DeployBlockeris not present and should not be added.Detailed Analysis
Evidence
Verification
src/pages/AddExistingExpense.tsx(renamed fromAddUnreportedExpense.tsx) andsrc/components/AddExistingExpenseFooter.tsx.getEligibleTransactions: previously only transactions withreportID === CONST.REPORT.UNREPORTED_REPORT_ID || reportID === ''were eligible. PR Feat: Change Add unreported expense to Add existing expense in a report #85225 expanded this to also include transactions on any open expense report (using the newopenExpenseReportIDsSelector).handleConfirmcallschangeTransactionsReportwhen moving expenses. That function, in section 9 ("Update next steps"), callsViolationsUtils.getViolationsOnyxDatafor the moved transaction in the context of the destination report's policy.shouldFixViolations = true.buildNextStepNewto optimistically generate a "Waiting for you to fix the issue" next step on the destination report. The message clears once the server responds with the correct state.Root Cause
The violation-computation logic in
changeTransactionsReport(lines 1152–1178 ofsrc/libs/actions/Transaction.ts) runsViolationsUtils.getViolationsOnyxDatafor each incoming transaction. For a draft-report expense being moved to a new report, this may produce violations optimistically (based on the destination policy's rules) and setshouldFixViolations = true. The resulting next-step computation then shows "Waiting for you to fix the issue" on the destination report's banner—even though the expense has no actual violations—until the server response clears the optimistic state.This code path was never exercised before PR #85225 because the old "Add unreported expense" flow only allowed moving truly unreported transactions (with no
reportID), which took a different branch inchangeTransactionsReport(theisUnreportedpath that clears violations rather than computing them).MelvinBot commentedon May 1, 2026
Proposal
What is the root cause of that problem?
When adding an existing expense to a report via
changeTransactionsReport, the client optimistically computes violations for the moved transaction usingViolationsUtils.getViolationsOnyxData. If the workspace policy requires categories or tags and the transaction doesn't have them set, policy violations likemissingCategoryare generated client-side. This setsshouldFixViolations = trueinTransaction.ts:1178-1179, which causesbuildOptimisticNextStepto produce aWAITING_TO_FIX_ISSUESnext step atNextStepUtils.ts:131-137.This optimistic next step is pushed to Onyx immediately, causing the "Waiting for you to fix the issues" message to render. When the server responds with the real next step (which doesn't include the fix-issues message since there are no actual blocking violations), the message disappears — producing the brief flash.
What changes do you think we should make in order to solve the problem?
The
shouldFixViolationsflag inchangeTransactionsReportshould not be set totruefor policy violations likemissingCategoryormissingTagwhen the transaction is being moved via "Add existing expense". These violations are informational and don't warrant the "fix the issues" next step message.Two possible approaches:
Filter out non-blocking violations when computing
shouldFixViolations— only set it totruefor violations that genuinely block submission (likeSMARTSCAN_FAILEDorNO_ROUTE), matching the logic already used inhasSubmissionBlockingViolations.Skip the optimistic next step computation for the
shouldFixViolationspath when handling the "add existing expense" flow, since the server will compute the correct next step.Approach 1 is preferred as it addresses the root cause and keeps optimistic updates accurate.
Investigation details
Data flow of the bug:
changeTransactionsReport()firesViolationsUtils.getViolationsOnyxData()generates optimistic violations (e.g.,missingCategoryif workspace requires categories)shouldFixViolationsset totruebecause non-duplicate violations existbuildOptimisticNextStep()producesWAITING_TO_FIX_ISSUESnext stepuseOptimisticNextStephook re-renders → flash appearsKey observation: The render-time path in
getReportNextStep(NextStepUtils.ts:357-375) already correctly limits the "fix issues" check to onlySMARTSCAN_FAILEDandNO_ROUTEviolations viahasSubmissionBlockingViolations. The optimistic path inchangeTransactionsReportshould follow the same pattern.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.nyomanjyotisa commentedon May 1, 2026
This issue is not caused by
#85225. The same issue exists in production as well, just with different reproduction steps.MacOS-Chrome.mp4
MacOS-Chrome.mp4
puneetlath commentedon May 1, 2026
Demoting and marking external.
57 remaining items
melvin-bot commentedon May 28, 2026
Triggered auto assignment to @mallenexpensify (
Awaiting Payment)melvin-bot commentedon May 28, 2026
Payment Summary
Upwork Job
BugZero Checklist (@mallenexpensify)
mallenexpensify commentedon May 29, 2026
Payment Summary
Contributor: @nabi-ebrahimi paid $250 via Upwork
Contributor+: @abzokhattab due $250 via Newdot
@nabi-ebrahimi , can you please accept the job below? Please reply here and tag me once you have.
If you're not sent an offer in Upwork when you're assigned to an issue, and an Upwork job exists, please submit a proposal.
^ Test case created. Thx
abzokhattab commentedon May 29, 2026
@mallenexpensify looks like the C+ details are wrong
mallenexpensify commentedon May 29, 2026
@abzokhattab apologies, updated.
nabi-ebrahimi commentedon May 31, 2026
@mallenexpensify, Accepted the offer. thanks.
nabi-ebrahimi commentedon May 31, 2026
@mallenexpensify, just to confirm, would you like me to submit a proposal for an Expensify Upwork job? Thx.
mallenexpensify commentedon Jun 1, 2026
@nabi-ebrahimi paid, summary updated above. Thx.
In the future, if you're not auto-sent a job offer once assigned to a GH, please submit a proposal in Upwork. Thx
quinthar commentedon Jun 13, 2026
Approved $250 to @abzokhattab