Skip to content

Expense - Wrong next step action when primary action button is Mark as done #93367

Closed

Description

@applause-bot

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


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.
  1. Go to staging.new.expensify.com
  2. Go to workspace chat.
  3. 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".

Workaround:

Unknown

Platforms:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome Safari

Screenshots/Videos

Bug7178432_1781225408967.6.mp4

View all open jobs on GitHub

Applause Internal Information
Exported by: Mita Rachim
Bug ID: 7178432

Activity

  1. applause-bot commented on Jun 12, 2026

    @applause-bot
    Author

    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

  2. added
    DeployBlockerCash
    Bug
    on Jun 12, 2026
  3. melvin-bot commented on Jun 12, 2026

    @melvin-bot

    You have been assigned to this deploy blocker because you recently merged this PR: #92254

  4. melvin-bot commented on Jun 12, 2026

    @melvin-bot

    💬 A slack conversation has been started in #expensify-open-source

  5. github-actions commented on Jun 12, 2026

    @github-actions
    Contributor

    👋 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:

    1. Identify the pull request that introduced this issue and revert it.
    2. Find someone who can quickly fix the issue.
    3. Fix the issue yourself.
  6. MelvinBot commented on Jun 12, 2026

    @MelvinBot
    Contributor

    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 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.

    Investigation details (evidence)

    Data flow:

    1. User creates an expense → App writes an optimistic next step. The override is applied correctly: NextStepUtils.ts buildOptimisticNextStep uses WAITING_TO_MARK_AS_DONE when shouldShowMarkAsDone() is true.
    2. 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.
    3. 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".
    4. 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.

  7. jayeshmangwani commented on Jun 12, 2026

    @jayeshmangwani
    Contributor

    @Valforte, this seems to be a backend issue.

  8. Valforte commented on Jun 12, 2026

    @Valforte
    Contributor

    @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!

  9. Valforte commented on Jun 12, 2026

    @Valforte
    Contributor

    BE PR created, I'll demote this from blocker as the fix is not on the Frontend

  10. 17 remaining items

  11. melvin-bot commented on Jul 1, 2026

    @melvin-bot

    @Valforte Now this issue is 8 days overdue. Are you sure this should be a Daily? Feel free to change it!

  12. added
    Weekly
    and removed
    Daily
    on Jul 3, 2026
  13. Valforte commented on Jul 14, 2026

    @Valforte
    Contributor

    Kind of forgot about it, I'll be back at it maybe today

  14. Valforte commented on Jul 28, 2026

    @Valforte
    Contributor

    Still looking into it

  15. Valforte commented on Jul 28, 2026

    @Valforte
    Contributor

    I couldn't reproduce in dev. Asking for a retest

  16. Valforte commented on Jul 28, 2026

    @Valforte
    Contributor

    I confirmed it's fixed in staging

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

BugEngineeringWeekly

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions