Skip to content

[Due for payment 2026-06-22] [Due for payment 2026-06-19] Report -Next step shows "Waiting for you to submit" on track expense moved to report offline #93373

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): ibellicotest+2766@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:

  1. Open the staging.new.expensify.com website.
  2. Sign up with a new account.
  3. Select "Track expenses for my business" during onboarding.
  4. Navigate to "Self DM"
  5. Create a manual expense.
  6. Turn off internet connection.
  7. Open the report of the just created expense.
  8. Click on the report field > "Create Report"
  9. Navigate to workspace chat where expense was moved.
  10. Note that preview shows "Mark as done" button.
  11. Open expense report.
  12. Note that next step message displays "Waiting for you to submit expense"

Expected Result:

Next step message of track expense that was moved to report on workspace, should display "Waiting for you to mark this as done".

Actual Result:

Next step message on track expense that was moved to workspace while offline. is displayed as "Waiting for you to submit expense", despite workspace having approvals/payments disabled.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7178472_1781229762629.Done_15.mp4

View all open jobs on GitHub

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

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/c40652f4e21756402a6880ce705fbdc765223a02ec7902b06072aef9cc44760c

  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

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    When a track-intent user (onboarded via "Track expenses for my business") moves a track expense from their Self DM onto a new workspace report via report field → "Create Report" while offline, the report's next-step header shows "Waiting for you to submit expense" instead of "Waiting for you to mark this as done" — even though the preview correctly shows a "Mark as done" button.

    What is the root cause of that problem?

    The optimistic next-step message is built with policy === undefined, which makes shouldShowMarkAsDone return false and fall back to the "submit" copy.

    The "Create Report" flow calls selectReport with an item literal that omits policyID:

    IOURequestEditReport.tsx:135-141

    selectReport({ value: optimisticReport.reportID, keyForList: optimisticReport.reportID }, optimisticReport);
    //            ^ no policyID

    selectReport then derives the policy from that missing field and passes it into changeTransactionsReport → buildNextStepNew:

    IOURequestEditReport.tsx:92 — policy: allPolicies?.[${POLICY}${item.policyID}] → with item.policyID === undefined, this is undefined.

    With policy undefined, isSubmitAndClose(undefined) returns false, short-circuiting shouldShowMarkAsDone before it ever checks the approver. The optimistic next step (built in NextStepUtils.ts:562) is therefore stored with the "submit" copy. Offline, the server never corrects it. The live "Mark as done" button renders correctly because it reads the real policy from Onyx at render time — hence the mismatch. (Introduced by #92254.)

    Why only this offline-move flow breaks

    The other three shouldShowMarkAsDone conditions hold at build time (isTrackIntentUser from persisted onboarding choice, isReportOwner from the optimistic report's ownerAccountID, and the approver check). Only isSubmitAndClose(policy) fails, purely because policy is undefined. Creating the expense directly in the workspace chat offline works because that flow has the policy. The correct policy (policyForNewReport/policyForMovingExpenses) is already in scope right at the call site.

    The same policy: allPolicies?.[${POLICY}${item.policyID}] pattern appears in IOURequestStepReport.tsx and useReportSelectionActions.ts:199 — worth checking those "Create Report" entry points for the same gap.

    What changes do you think we should make in order to solve the problem?

    Pass the known destination policy through the "Create Report" path so the optimistic next step is built with it. Minimal fix: include policyID on the synthesized item in createReportForPolicy:

    selectReport(
        {
            value: optimisticReport.reportID,
            keyForList: optimisticReport.reportID,
            policyID: policyForNewReport?.id,
        },
        optimisticReport,
    );

    policyForNewReport is already computed one line above (IOURequestEditReport.tsx:133). This makes line 92 resolve the real submit-and-close policy, isSubmitAndClose returns true, and the optimistic next step renders "mark this as done". Apply the same fix to the equivalent literals in IOURequestStepReport.tsx / useReportSelectionActions.ts if they drive the same flow.

    What alternative solutions did you explore?

    Plumb the policy object directly through selectReport → changeTransactionsReport for all callers. This is more robust but touches more call sites; the policyID-on-item fix is the smaller, lower-risk change for a deploy blocker.


    Next Steps for Contributor+ team:
    To accept: @MelvinBot implement [this](https://github.com/Expensify/App/issues/93373) to create a draft PR.
    To refine: @MelvinBot <your feedback>
    To reject: Explain why you are rejecting Melvin's proposal.

  7. melvin-bot commented on Jun 12, 2026

    @melvin-bot

    ⚠️ Looks like this issue was linked to a Deploy Blocker here

    If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

    If a regression has occurred and you are the assigned CM follow the instructions here.

    If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

  8. added
    Reviewing
    on Jun 12, 2026
  9. m-natarajan commented on Jun 12, 2026

    @m-natarajan

    Passed, Chrome and Xiaomi Redmi Note 10 / Android 12 / v9.4.6-4

    Screenrecorder-2026-06-12-23-57-27-934.mp4
    REC-20260613001311.mp4
  10. removed
    DeployBlockerCash
    on Jun 12, 2026
  11. added
    Daily
    and removed
    Reviewing
    Hourly
    on Jun 12, 2026
  12. changed the title [-]Report -Next step shows "Waiting for you to submit" on track expense moved to report offline[/-] [+][Due for payment 2026-06-19] Report -Next step shows "Waiting for you to submit" on track expense moved to report offline[/+] on Jun 12, 2026
  13. melvin-bot commented on Jun 12, 2026

    @melvin-bot

    Reviewing label has been removed, please complete the "BugZero Checklist".

  14. melvin-bot commented on Jun 12, 2026

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.4.6-4 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-06-19. 🎊

  15. melvin-bot commented on Jun 12, 2026

    @melvin-bot

    @Valforte 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]. If no checklist is needed for this issue, you can click: [no checklist button]

  16. changed the title [-][Due for payment 2026-06-19] Report -Next step shows "Waiting for you to submit" on track expense moved to report offline[/-] [+][Due for payment 2026-06-22] [Due for payment 2026-06-19] Report -Next step shows "Waiting for you to submit" on track expense moved to report offline[/+] on Jun 15, 2026
  17. melvin-bot commented on Jun 15, 2026

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.4.7-4 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-06-22. 🎊

  18. melvin-bot commented on Jun 15, 2026

    @melvin-bot

    @Valforte 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]. If no checklist is needed for this issue, you can click: [no checklist button]

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

Metadata

Metadata

Assignees

Labels

BugDailyEngineering

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions