Skip to content

[Due for payment 2026-06-16] [Due for payment 2026-06-12] Expense - Expense report does not open after changing report and creating expense #92641

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.3.99-0
Reproducible in staging?: Yes
Reproducible in production?: No
If this was caught during regression testing, add the test name, ID and link from BrowserStack: #91266
Email or phone of affected tester (no customers): jojsonsjosjdosij@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:

  1. Go to staging.new.expensify.com
  2. Go to workspace chat.
  3. Create two empty reports and rename them to A and B.
  4. Click + > Create expense > Manual.
  5. Enter amount > Next.
  6. On confirm page, enter merchant and click Report field.
  7. Select report A.
  8. Click Create expense.

Expected Result:

Report A will open after changing report and creating expense.

Actual Result:

Report A does not open after changing report and creating expense.
This issue also happens when user selects Create report in Step 7 instead of selecting existing report.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7171289_1780560136647.2.mp4

View all open jobs on GitHub

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

Issue OwnerCurrent Issue Owner: @brunovjk

Activity

  1. applause-bot commented on Jun 4, 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/e14aebfef763c245365073cc30ec27f82c0b9e92c5be8c828295aa8561e11988

  2. added
    DeployBlockerCashThis issue or pull request should block deployment
    BugSomething is broken. Auto assigns a BugZero manager.
    on Jun 4, 2026
  3. melvin-bot commented on Jun 4, 2026

    @melvin-bot

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

  4. melvin-bot commented on Jun 4, 2026

    @melvin-bot

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

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

    @MelvinBot
    Contributor

    Proposal

    Regression from #91266 (fix for #91093). Staging-only, matching "Reproducible in production?: No".

    What is the root cause of that problem?

    When you create an expense from the workspace chat and explicitly pick a destination report (select report A, or Create report) on the confirmation page, the app reveals the parent workspace chat after submit instead of the report you chose.

    PR #91266 changed how destinationReportID is computed in IOURequestStepConfirmation.tsx:482:

    // before: backToReport ?? report?.reportID ?? selfDMReportID
    // after:  backToReport ?? (isMRReport && getTopmostReportId() !== report?.reportID ? report?.chatReportID : report?.reportID) ?? selfDMReportID
    

    After you select report A, report becomes that expense (money-request) report, so isMRReport is true. Because you are still viewing the workspace chat behind the RHP, getTopmostReportId() is the workspace chat, not report A — so the new branch resolves destinationReportID to report.chatReportID (the workspace chat) instead of report A. destinationReportID is exactly what gets revealed after submit, so you land on the workspace chat. Create report hits the same branch (the new report is also a money-request report).

    Evidence — why this is the regression
    • After-submit navigation reveals destinationReportID: SubmitExpenseOrchestrator.tsx:294 (handleDismissToReport → revealRouteBeforeDismissingModal(REPORT_WITH_ID.getRoute(destinationReportID))).
    • The PR's intent (per fix: per diem from report preview lands on workspace chat #91266 description) was to fix per-diem launched from a report preview's Add expense, where backToReport (the workspace chat) should be set but gets dropped by the per-diem step screens. As a workaround the PR inferred the chat from report.chatReportID whenever report is a money-request report the user isn't currently viewing.
    • That heuristic is too broad: in the global-create / explicit-selection flow the user is never viewing the chosen expense report, yet they explicitly want to open it. So the workaround mis-fires and redirects to the parent chat.
    • Confirmed the per-diem steps drop backToReport: IOURequestStepDestination.tsx, IOURequestStepTime.tsx, IOURequestStepSubrate.tsx contain no reference to backToReport, so it is undefined by the time confirmation renders — which is the real bug the PR was working around.
    • Staging-only (PR merged to staging 2026-06-03, issue filed 2026-06-04), consistent with the report.

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

    Immediate (deploy blocker): revert #91266. The issue it fixed (#91093 — an expense report opening when it shouldn't) is lower severity than this regression (an explicitly-chosen report failing to open).

    Proper re-fix: address the actual cause the PR identified instead of inferring the chat from report. Propagate backToReport through the per-diem step screens (STEP_DESTINATION, STEP_TIME, STEP_SUBRATE) so it reaches IOURequestStepConfirmation, then restore destinationReportID to backToReport ?? report?.reportID ?? selfDMReportID. This fixes per-diem-from-preview without the chatReportID heuristic that breaks explicit report selection.

    What alternative solutions did you explore? (Optional)

    Narrowly gate the chatReportID fallback to the per-diem path only (so Manual/Scan/Distance keep their pre-PR behavior of opening the selected report). This is smaller but still leaves per-diem unable to honor an explicitly-selected report on the confirm page, so the backToReport propagation above is preferred.

    Related issues


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

  7. lakchote commented on Jun 4, 2026

    @lakchote
    Contributor

    @MobileMage seems to be coming from #91266 can you take a look please?

  8. MobileMage commented on Jun 4, 2026

    @MobileMage
    Contributor

    Yup this was from an oversight, working on a PR with fix.

  9. MobileMage commented on Jun 4, 2026

    @MobileMage
    Contributor

    Proposal

    What is the root cause of that problem?

    PR #91266 changed how destinationReportID is computed in IOURequestStepConfirmation.tsx:482:

    • Before: backToReport ?? report?.reportID ?? selfDMReportID
    • After: backToReport ?? (isMRReport && getTopmostReportId() !== report?.reportID ? report?.chatReportID : report?.reportID) ?? selfDMReportID

    In the repro (workspace chat → + → Manual → amount → on the confirm page change Report to A → Create expense):

    • backToReport is undefined (Manual from the workspace chat doesn't set it).
    • After picking Report A, report is the expense report A, so isMRReport is true.
    • The workspace chat is still the topmost report behind the RHP, so getTopmostReportId() !== report.reportID is true.
    • The new branch resolves destinationReportID to report.chatReportID — Report A's parent workspace chat — instead of Report A.

    destinationReportID is what the pre-insert and submit-dismiss flows reveal (see SubmitExpenseOrchestrator.tsx:294), so the user lands back on the workspace chat. Selecting Create report in step 7 hits the same branch because the new report is also a money-request report.

    The heuristic was added to handle a different flow — per diem launched from a report preview's Add expense (issue #91093) — where backToReport should be the workspace chat but is dropped by the per-diem step screens (STEP_DESTINATION, STEP_TIME, STEP_SUBRATE don't carry it). The heuristic recovered the chat from report.chatReportID as a workaround, but it wasn't scoped to per-diem, so Manual / Scan / Distance now fall into the same branch and lose the user's explicit report selection.

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

    Gate the heuristic on per diem only. isPerDiemRequest is already in scope at line 144 of the same file, so the change is a single added condition:

    destinationReportID = backToReport ?? (isPerDiemRequest && isMRReport && getTopmostReportId() !== report?.reportID ? report?.chatReportID : report?.reportID) ?? selfDMReportID

    After this:

    The matching backToReport ?? activeReportID change in useExpenseSubmission.ts:568 lives inside submitPerDiemExpense (defined at line 475) and never runs for Manual / Scan / Distance, so it does not need to change for this fix.

    What alternative solutions did you explore? (Optional)

  10. 10 remaining items

  11. brunovjk commented on Jun 5, 2026

    @brunovjk
    Contributor

    Sorry for the delay, thank you for resolving this.

  12. changed the title [-]Expense - Expense report does not open after changing report and creating expense[/-] [+][Due for payment 2026-06-12] Expense - Expense report does not open after changing report and creating expense[/+] on Jun 5, 2026
  13. melvin-bot commented on Jun 5, 2026

    @melvin-bot

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

  14. melvin-bot commented on Jun 5, 2026

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.3.99-9 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-12. 🎊

    For reference, here are some details about the assignees on this issue:

    • @MobileMage requires payment (Needs manual offer from BZ)
    • @brunovjk requires payment through NewDot Manual Requests
  15. melvin-bot commented on Jun 5, 2026

    @melvin-bot

    @brunovjk 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. mkhutornyi commented on Jun 7, 2026

    @mkhutornyi
    Contributor

    This was closed without C+ payment.
    @lakchote can you please reopen?

  17. brunovjk commented on Jun 8, 2026

    @brunovjk
    Contributor

    Update: This issue stems from a regression from this PR. The C+ @mkhutornyi reviewed this PR, which fixed the regression.

  18. changed the title [-][Due for payment 2026-06-12] Expense - Expense report does not open after changing report and creating expense[/-] [+][Due for payment 2026-06-16] [Due for payment 2026-06-12] Expense - Expense report does not open after changing report and creating expense[/+] on Jun 9, 2026
  19. melvin-bot commented on Jun 9, 2026

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.4.0-7 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-16. 🎊

    For reference, here are some details about the assignees on this issue:

    • @MobileMage requires payment (Needs manual offer from BZ)
    • @brunovjk requires payment through NewDot Manual Requests
  20. melvin-bot commented on Jun 9, 2026

    @melvin-bot

    @brunovjk 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]

  21. mkhutornyi commented on Jun 15, 2026

    @mkhutornyi
    Contributor

    @mallenexpensify can you please help with payment? Thanks

  22. mallenexpensify commented on Jun 17, 2026

    @mallenexpensify
    Contributor

    Payment Summary

    Contributor+: @mkhutornyi due $250 via NewDot

    @mkhutornyi plz include the bz checklist in the future, even for instances like these (so I don't have to dig around to find out what's up before paying).

    @brunovjk plz try to be more punctual on regressions you're responsible for (I think that's what happened here...)

  23. trjExpensify commented on Jun 23, 2026

    @trjExpensify
    Contributor

    approved $250 for @mkhutornyi

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

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.DailyKSv2Engineering

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions