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
Expense - Wrong next step action when primary action button is Mark as done #93367
Version Number: 9.4.6-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:#92254 Email or phone of affected tester (no customers):sodijnosjdosjodsj@gmail.com Issue reported by: Applause Internal Team Bug source: Exploratory - Significant User Experience Deterioration Device used: Mac 26.5 / Chrome App Component: Money Requests
Action Performed:
Precondition:
Complete onboarding with Organize my personal spending.
Enable Workflows.
Set Submissions to Manually.
Disable Approvals and Payments.
Go to staging.new.expensify.com
Go to workspace chat.
Create an expense.
Expected Result:
Next step action will show "Waiting for you to mark this as done".
Actual Result:
Next step action shows "Waiting for you to mark this as done", then changes to "Waiting for you to submit expenses".
👋 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.
Root Cause: This is a backend issue, not an App issue. The App computes a correct optimistic next step ("Waiting for you to mark this as done") for track-intent users, but the server then returns its own nextStep value that overwrites the optimistic one with the generic "Waiting for you to submit expenses." The backend's next-step builder doesn't have the track-intent "mark as done" override that PR #92254 added on the client side — so after the create-expense round-trip completes, the server value wins and the message flips.
This explains the exact symptom: the correct text shows first (optimistic), then changes to the wrong text (server response).
Recommended Fix: The fix must be made in the backend (server-side next-step computation), which lives outside the Expensify/App repo. The backend needs to mirror the App's shouldShowMarkAsDone condition — track-intent user (PERSONAL_SPEND / TRACK_WORKSPACE) + submit-and-close policy (approvals/payments disabled) + report owner is the next approver — and emit "mark this as done" instead of "submit" for the OPEN-state next step. This requires an internal engineer with access to the backend repository. No App-side change will fix this, because the App already produces the correct optimistic value and the server overwrites it.
The header reads the stored next step from the reportNextStep_<id> Onyx collection and prefers the server's deprecated message[] format when present: MoneyReportHeaderStatusBar.tsx. The same file notes the backend still ships the deprecated format.
When the create-expense API response returns, its onyxData (and/or the Pusher update) contains a reportNextStep_<id> value generated by the backend — which still says "submit". applyHTTPSOnyxUpdates writes the server's value into Onyx, replacing the optimistic "mark as done".
The header re-renders with the server value → "Waiting for you to submit expenses."
Why it's not an App bug: No client-side code path overwrites the optimistic value with "submit" — the successData/failureData for the create flow only clear pendingFields.nextStep, they never re-write the reportNextStep_<id> collection. The only thing that can change it after the optimistic write is the server's response payload.
Repro conditions match the override condition: "Organize my personal spending" onboarding + manual submission + approvals/payments disabled = submit-and-close, owner submits to self → shouldShowMarkAsDone is true, so the optimistic value is correct and only the server value is wrong.
Next Steps: This is a deploy blocker whose fix lives in the backend (outside Expensify/App). An internal engineer should update the server-side next-step builder to apply the same track-intent "mark as done" override for OPEN-state reports on submit-and-close policies. Reply with @MelvinBot <feedback> to refine this analysis.
@jayeshmangwani looks like there is also a front-end related issue as this one #93373 happens when offline
I'll try to fix the backend, can you work on the other issue? If we can expedite those fixes and avoid a revert it would be great!
Activity
applause-bot commentedon Jun 12, 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/12395f23c966275f266d918567c08738fc6fc3c565488670a70d4723556b5afa
melvin-bot commentedon Jun 12, 2026
You have been assigned to this deploy blocker because you recently merged this PR: #92254
melvin-bot commentedon Jun 12, 2026
💬 A slack conversation has been started in #expensify-open-source
github-actions commentedon Jun 12, 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 Jun 12, 2026
Issue Analysis
Root Cause: This is a backend issue, not an App issue. The App computes a correct optimistic next step ("Waiting for you to mark this as done") for track-intent users, but the server then returns its own
nextStepvalue that overwrites the optimistic one with the generic "Waiting for you to submit expenses." The backend's next-step builder doesn't have the track-intent "mark as done" override that PR #92254 added on the client side — so after the create-expense round-trip completes, the server value wins and the message flips.This explains the exact symptom: the correct text shows first (optimistic), then changes to the wrong text (server response).
Recommended Fix: The fix must be made in the backend (server-side next-step computation), which lives outside the
Expensify/Apprepo. The backend needs to mirror the App'sshouldShowMarkAsDonecondition — track-intent user (PERSONAL_SPEND/TRACK_WORKSPACE) + submit-and-close policy (approvals/payments disabled) + report owner is the next approver — and emit "mark this as done" instead of "submit" for the OPEN-state next step. This requires an internal engineer with access to the backend repository. No App-side change will fix this, because the App already produces the correct optimistic value and the server overwrites it.Investigation details (evidence)
Data flow:
NextStepUtils.tsbuildOptimisticNextStepusesWAITING_TO_MARK_AS_DONEwhenshouldShowMarkAsDone()is true.reportNextStep_<id>Onyx collection and prefers the server's deprecatedmessage[]format when present:MoneyReportHeaderStatusBar.tsx. The same file notes the backend still ships the deprecated format.onyxData(and/or the Pusher update) contains areportNextStep_<id>value generated by the backend — which still says "submit".applyHTTPSOnyxUpdateswrites the server's value into Onyx, replacing the optimistic "mark as done".Why it's not an App bug: No client-side code path overwrites the optimistic value with "submit" — the
successData/failureDatafor the create flow only clearpendingFields.nextStep, they never re-write thereportNextStep_<id>collection. The only thing that can change it after the optimistic write is the server's response payload.Repro conditions match the override condition: "Organize my personal spending" onboarding + manual submission + approvals/payments disabled = submit-and-close, owner submits to self →
shouldShowMarkAsDoneis true, so the optimistic value is correct and only the server value is wrong.Next Steps: This is a deploy blocker whose fix lives in the backend (outside
Expensify/App). An internal engineer should update the server-side next-step builder to apply the same track-intent "mark as done" override for OPEN-state reports on submit-and-close policies. Reply with@MelvinBot <feedback>to refine this analysis.jayeshmangwani commentedon Jun 12, 2026
@Valforte, this seems to be a backend issue.
Valforte commentedon Jun 12, 2026
@jayeshmangwani looks like there is also a front-end related issue as this one #93373 happens when offline
I'll try to fix the backend, can you work on the other issue? If we can expedite those fixes and avoid a revert it would be great!
Valforte commentedon Jun 12, 2026
BE PR created, I'll demote this from blocker as the fix is not on the Frontend
17 remaining items
melvin-bot commentedon Jul 1, 2026
@Valforte Now this issue is 8 days overdue. Are you sure this should be a Daily? Feel free to change it!
Valforte commentedon Jul 14, 2026
Kind of forgot about it, I'll be back at it maybe today
Valforte commentedon Jul 28, 2026
Still looking into it
Valforte commentedon Jul 28, 2026
I couldn't reproduce in dev. Asking for a retest
kavimuru commentedon Jul 28, 2026
Bug is reproducible in Production
https://github.com/user-attachments/assets/fa77ac40-7da2-490b-aacf-97052f6e9ed8
https://github.com/user-attachments/assets/8b3e7538-fb91-4342-9683-579e9c500c3b
Valforte commentedon Jul 28, 2026
I confirmed it's fixed in staging