Skip to content

[Due for payment 2026-07-30] Submit workspace-Missing receipt modal on confirm page when submitting expense without receipt #96214

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.34-12
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: #94319
Email or phone of affected tester (no customers): applausetester+sdoisdddndos@applause.expensifail.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:

  • Log in with Expensifail account.
  • Account has no workspace.
  1. Go to staging.new.expensify.com
  2. Go to self DM.
  3. Create a manual expense without receipt.
  4. Click Submit to my employer.

Expected Result:

Confirm page should show receipt modal so user can add a receipt.

Actual Result:

Confirm page is missing receipt modal when submitting manual expense without receipt.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

To be added by Applause Leads

View all open jobs on GitHub

Applause Internal Information
Exported by: Svetlana Lazutkina
Bug ID: 7209310

Issue OwnerCurrent Issue Owner: @abzokhattab

Activity

  1. added
    DeployBlockerCash
    Bug
    on Jul 15, 2026
  2. applause-bot commented on Jul 15, 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/d14b6bd5e5f385071fddd18754319b45f7def847a380d245100e7ea763a15ab4

  3. melvin-bot commented on Jul 15, 2026

    @melvin-bot

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

  4. melvin-bot commented on Jul 15, 2026

    @melvin-bot

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

  5. github-actions commented on Jul 15, 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 Jul 15, 2026

    @MelvinBot
    Contributor

    Proposal

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

    On the confirmation page, the receipt "empty state" (the dropzone/prompt to add a receipt) is missing when a user with no workspace creates a manual expense without a receipt from their self DM and chooses Submit to my employer. This is a regression introduced by #94319, which split "Submit it to someone" into "Submit to a friend" / "Submit to my employer" and added a brand-new SUBMIT path that lands directly on the confirmation page.

    What is the root cause of that problem?

    The receipt empty state is gated by shouldShowReceiptEmptyState, which for the SUBMIT action only shows when isGroupPolicy(policy) is true:

    Gate logic (IOUUtils.ts)
    // shouldShowReceiptEmptyState
    (iouType === SUBMIT || TRACK || PAY || CREATE) &&
    !isPerDiemRequest &&
    (!isMovingTransactionFromTrackExpense(action) || isGroupPolicy(policy))

    For action === SUBMIT, isMovingTransactionFromTrackExpense returns true, so the empty state hinges entirely on isGroupPolicy(policy).

    For this new self-DM → "Submit to my employer" flow, policy resolves to undefined at render time. usePolicyForTransaction returns the self-DM policy (which is undefined for a user with no workspace) whenever the transaction is still unreported, and only falls back to policyDraft in the reported branch:

    const policy = isUnreportedExpense || isCreatingTrackExpense ? policyForSelfDMExpense : (reportPolicy ?? policyDraft);

    So isGroupPolicy(undefined) === false → shouldShowReceiptEmptyState returns false → the receipt empty state is hidden. The old "Submit to a friend" path always routed through the participant selector where a real group policy was chosen, so policy was always a group policy there — which is why this only regressed for the new employer/draft-workspace path.

    Key references (HEAD 763218c)

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

    Stop gating the receipt empty state on policy being a fully-hydrated group policy for the new draft-submit flow. Reuse the existing isSubmittingExpenseToDraftWorkspace concept (already added in useExpenseSubmission.ts) and OR it into the empty-state condition so the receipt prompt shows for the "Submit to my employer" / draft-workspace path regardless of whether policy has resolved yet.

    Concretely: pass an isSubmittingToDraftWorkspace flag into shouldShowReceiptEmptyState and change the final clause from (!isMovingTransactionFromTrackExpense(action) || isGroupPolicy(policy)) to also allow that flag, then compute it at IOURequestStepConfirmation.tsx:822.

    Alternatively, adjust usePolicyForTransaction.ts:50 so the SUBMIT action falls back to policyDraft even when the transaction is still unreported, so policy resolves consistently to the draft submit workspace.

    Confidence

    Medium-high. The suppression point (isGroupPolicy(policy) gate with action === SUBMIT) is unambiguous, and this path is new in #94319. The one open question is render-timing: whether the draft transaction still reads UNREPORTED on first render (which makes policy undefined). Confirming with a quick repro + a log of iouType, action, policy?.type, transaction?.reportID at the gate line would pin down the exact sub-case.


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

  7. MelvinBot commented on Jul 15, 2026

    @MelvinBot
    Contributor

    🔍 Investigation Summary

    Classification: Frontend bug (fix lives in Expensify/App)
    Causing PR: #94319 - "[Submit] Update "Submit to someone" to two options to allow for Submit workspace creation" by @abzokhattab (High confidence)
    Related Issues: StagingDeployCash #96044 (9.4.34 release)

    Recommendation: ROLL FORWARD (targeted forward-fix, not revert)

    #94319 is a large feature PR (27 files, +341/-73) that ships the entire "Submit to my employer" workspace-creation flow; a revert would be highly disruptive and pull a shipping feature. The bug is a single missing case in the receipt empty-state gating for the new SUBMIT path, which is a narrow, CP-able forward-fix.

    Assigned: @abzokhattab (PR author), @hungvu193 and @iwiznia (approving reviewers)
    Labels: No change. DeployBlockerCash kept — this is a frontend bug and the App deploy is correctly blocked. No DeployBlocker present to remove.

    📋 Detailed Analysis

    Evidence

    Verification

    • Affected file (symptom): src/pages/iou/request/step/IOURequestStepConfirmation.tsx
      • line 187: const {policy} = usePolicyForTransaction({...})
      • line 822: const showReceiptEmptyState = shouldShowReceiptEmptyState(iouType, action, policy, isPerDiemRequest)
    • Gate logic: src/libs/IOUUtils.ts:324-334 — for action === SUBMIT, isMovingTransactionFromTrackExpense returns true (line 317), so the empty state depends entirely on isGroupPolicy(policy).
    • Policy resolution: src/hooks/usePolicyForTransaction.ts:50
      const policy = isUnreportedExpense || isCreatingTrackExpense ? policyForSelfDMExpense : (reportPolicy ?? policyDraft);
      For an unreported self-DM expense with no workspace, policyForSelfDMExpense is undefined, and the policyDraft fallback is only reached in the reported branch. So policy = undefined → isGroupPolicy(undefined) = false → empty state hidden.
    • Note on ownership of the hook: usePolicyForTransaction.ts itself was last modified by Part 11 - Thread delegateAccountID through split and inline edit flows #95328, so the fallback logic is pre-existing. However, [Submit] Update "Submit to someone" to two options to allow for Submit workspace creation #94319 is the PR that first drives the new SUBMIT-to-employer/draft-workspace path into this code, exposing the unhandled undefined-policy state. [Submit] Update "Submit to someone" to two options to allow for Submit workspace creation #94319 is the correct owner of the regression.

    Root Cause

    The new "Submit to my employer" flow routes an unreported self-DM expense straight to the confirmation page. At render time, for a user with no workspace, usePolicyForTransaction returns undefined (the self-DM/moving-expenses policy) because the transaction is unreported, and never falls back to the draft workspace policy. shouldShowReceiptEmptyState gates the SUBMIT empty state on isGroupPolicy(policy), which is false for undefined, so the receipt empty-state / add-receipt prompt is suppressed.

    Suggested forward-fix (for the owner)

    Make the empty state resolve correctly for the new SUBMIT path, e.g. one of:

    • Have usePolicyForTransaction fall back to policyDraft for the unreported SUBMIT-to-employer case (so policy reflects the draft/soon-to-be-created Submit workspace), or
    • Adjust shouldShowReceiptEmptyState so the SUBMIT action shows the empty state when a submit/draft-workspace destination is in play even if policy is not yet a group policy.

    The author should confirm which is safest given the draft-workspace-creation timing.

  8. jasperhuangg commented on Jul 15, 2026

    @jasperhuangg
    Contributor

    This is bound to a beta, so we can demote.

  9. 9 remaining items

  10. lanitochka17 commented on Jul 22, 2026

    @lanitochka17

    Deploy Blocker #96796 was identified to be related to the PR #96136 that attempted to fix this issue.

  11. melvin-bot commented on Jul 22, 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.

  12. added
    Daily
    and removed
    Reviewing
    Weekly
    on Jul 23, 2026
  13. changed the title [-]Submit workspace-Missing receipt modal on confirm page when submitting expense without receipt[/-] [+][Due for payment 2026-07-30] Submit workspace-Missing receipt modal on confirm page when submitting expense without receipt[/+] on Jul 23, 2026
  14. melvin-bot commented on Jul 23, 2026

    @melvin-bot

    @abzokhattab

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.4.43-1 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-07-30. 🎊

    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]

  15. melvin-bot commented on Jul 27, 2026

    @melvin-bot

    @abzokhattab Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

  16. hungvu193 commented on Jul 28, 2026

    @hungvu193
    Contributor

    Closing since it was fixed and no payment due.

  17. melvin-bot commented on Aug 19, 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.

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

Metadata

Metadata

Labels

BugDailyEngineering

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions