Skip to content

[Due for payment 2026-06-02] When there are open reports, Confirm page shows wrong report, double confirm page opens #90677

Closed

Description

@jponikarchuk

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.74-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: #87920
Email or phone of affected tester (no customers): sdsdjoijdoisnjodis@gmail.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: Mac 26.2 / Chrome
App Component: Money Requests

Action Performed:

Precondition:

  • Run Onyx.merge('betas', ['newManualExpenseFlow']); in console.
  1. Go to staging.new.expensify.com
  2. Go to workspace chat.
  3. Create two empty reports and rename them to A and B respectively.
  4. Open FAB > Create expense > Manual.
  5. Click Report field.
    → Report field shows report A, but report B is actually selected.
  6. Select report A.
  7. Click RHP back button twice.
    → Another confirm page opens after selecting a different report, instead of landing on the same confirm page from Step 4.
  8. Scroll down to Report field.
    → Report field becomes read-only.

Expected Result:

In Step 5, Report field will show the same report (A or B) as selected.
In Step 7, after selecting a different report, RHP will return to the same confirm page from Step 4.
In Step 8, Report field will be edited because there are two open reports.

Actual Result:

In Step 5, Report field shows report A, but report B is actually selected.
In Step 7, Another confirm page opens after selecting a different report, instead of landing on the same confirm page from Step 4.
In Step 8, Report field becomes read-only.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Video.mp4

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @ChavdaSachin

Activity

  1. added
    DeployBlockerCash
    Bug
    on May 14, 2026
  2. melvin-bot commented on May 14, 2026

    @melvin-bot

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

  3. melvin-bot commented on May 14, 2026

    @melvin-bot

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

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

    @OSBotify
    Contributor

    Investigation Summary

    Classification: Frontend bug
    Causing PR: #87920 - "Feat: Manual expense flow UI refactor - r3" by @ChavdaSachin (High confidence)
    Related Issues: #82586 (the issue this PR was fixing)

    Recommendation: REVERT

    This PR introduced the new manual expense flow (newManualExpenseFlow beta) with several regressions in report/participant selection behavior on the Confirm page. Reverting it will restore the pre-existing behavior while a proper fix is authored.

    Assigned: @ChavdaSachin (PR author), @ShridharGoel @puneetlath (approving reviewers)
    Labels: DeployBlockerCash kept (frontend App PR caused the issue). No label changes made.

    📋 Detailed Analysis

    Evidence

    PR #87920 merged on 2026-05-13 (the same day/cycle as this staging version 9.3.74-0). The issue is flagged as "new feature, doesn't exist in prod" and requires the newManualExpenseFlow beta to reproduce — exactly the beta this PR implements.

    The three bugs reported all trace directly to new logic introduced in this PR:

    Bug 1 — Report field shows wrong report (display vs. selected mismatch):
    The PR changed IOURequestStepConfirmation to embed itself inside IOURequestStartPage when isNewManualExpenseFlowEnabled. It also added a defaultParticipants derivation that calls getMoneyRequestParticipantsFromReport on a source report and conditionally falls back to a defaultExpensePolicy report. If the user is in a workspace chat with two open reports (A and B), the defaultParticipants memo may resolve a different report than what the participant row visually reflects — causing the display/selection mismatch in Step 5.

    Bug 2 — Double confirm page after selecting a different report:
    The PR added a new ParticipantPicker modal (rendered as a RIGHT_DOCKED modal on top of the confirmation page) and a new onOpenParticipantPicker prop that is wired to navigateToParticipantPage when isNewManualExpenseFlowEnabled. When the user clicks the Report field, instead of navigating away to IOURequestStepParticipants (the legacy path), the picker modal opens over the confirmation page. After selecting a different report and pressing back, the navigation stack ends up with the confirmation page visible twice — once from the original RHP stack and once from the modal close path. This is the "another confirm page opens" described in Step 7.

    Bug 3 — Report field becomes read-only when two open reports exist:
    canEditParticipant is set to isFromGlobalCreateAndCanEditParticipant && !isTestReceipt && (!isRestrictedToPreferredPolicy || isTypeInvoice). The isFromGlobalCreateAndCanEditParticipant guard requires transaction?.isFromGlobalCreate. In the new flow, when there are two open workspace reports (A and B), the defaultParticipants logic at line 275–286 of IOURequestStepConfirmation may auto-assign a participant, setting transaction.participantsAutoAssigned = true — but the transaction's isFromGlobalCreate flag is not always set or correctly propagated when the confirmation is embedded in IOURequestStartPage. When isFromGlobalCreate is falsy, canEditParticipant is false, causing both isInteractive: false and shouldShowRightCaret: false on the participant row — making the Report field appear read-only.

    Verification

    Affected files confirmed modified by PR #87920:

    • src/pages/iou/request/step/IOURequestStepConfirmation.tsx — added defaultParticipants derivation, ParticipantPicker modal, onOpenParticipantPicker prop wiring, and shouldHideHeader embedding support
    • src/components/MoneyRequestConfirmationList.tsx — added onOpenParticipantPicker prop, shouldForceTopEmptySections, and changed navigateToParticipantPage to open the picker instead of navigating
    • src/components/MoneyRequestConfirmationList/hooks/useConfirmationSections.ts — changed participant row interactivity driven by canEditParticipant
    • src/pages/iou/request/IOURequestStartPage.tsx — embeds IOURequestStepConfirmation directly in the Manual tab when isNewManualExpenseFlowEnabled
    • src/components/ParticipantPicker.tsx — new component (added by this PR)

    The issue is staging-only ("N/A - new feature, doesn't exist in prod"), consistent with this PR being part of the current staging deploy and behind a beta flag.

    Root Cause

    The new manual expense flow embeds the confirmation screen inside the tab navigator and replaces the navigate-away participant selection with a modal-based picker. The implementation has at least three logic gaps: (1) the default participant resolution can derive a different report than what the confirmation list displays, (2) the modal-based participant picker leaves a stale confirmation page in the navigation stack after the user closes and re-navigates, and (3) the isFromGlobalCreate guard for canEditParticipant is not reliably propagated in the embedded flow, causing the Report field to render as non-interactive when there are multiple open reports.

  6. MelvinBot commented on May 14, 2026

    @MelvinBot
    Contributor

    Proposal

    What is the root cause of that problem?

    There are three interrelated bugs, all stemming from how the new manual expense flow (beta newManualExpenseFlow) embeds IOURequestStepConfirmation directly inside IOURequestStartPage rather than as a standalone navigation screen.

    Bug 1 — Wrong report displayed: ReportField.tsx:82 resolves the displayed report differently depending on whether the transaction's reportID points to an outstanding IOU report or a workspace chat. On initial creation, transaction.reportID is the workspace chat ID (not an IOU report), so isReportOutstanding() returns false and the display falls back to mainReport.iouReportID at line 82. This iouReportID on the workspace chat may point to report A, while the first available outstanding report (or the one intended by the user) is report B.

    Meanwhile, IOURequestStepReport.tsx:51-52 uses participantReport?.iouReportID (derived from the participant's reportID) to determine the "selected" report. These two resolution paths can disagree.

    Bug 2 — Double confirm page: When a report is selected, handleGlobalCreateReport navigates to MONEY_REQUEST_STEP_CONFIRMATION route. But with the new flow, the confirmation page is embedded inside the MONEY_REQUEST_CREATE (START) page at IOURequestStartPage.tsx:251-256 — no standalone STEP_CONFIRMATION screen exists in the navigation stack. When Navigation.goBack can't find the target route, it falls back to a REPLACE action, creating a standalone confirmation page on top of the embedded one.

    Additionally, isFromGlobalCreate is computed inconsistently — IOURequestStepReport.tsx:61 only checks transaction?.isFromGlobalCreate, while IOURequestStepConfirmation.tsx:382 also includes isFromFloatingActionButton. This mismatch can cause the wrong handler to be selected.

    Bug 3 — Read-only report field: After the double confirm page is created with a new route, the reportID param may now be an IOU report ID rather than a workspace chat ID. ReportField.tsx:115 has !isMoneyRequestReport(reportID) as a condition for editability — if reportID is now an IOU/money request report, this returns true, blocking editability.

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

    1. Fix navigation after report selection (Bug 2): In handleGlobalCreateReport (useReportSelectionActions.ts:153), when the new manual expense flow is enabled and the confirmation is embedded inside IOURequestStartPage, the function should navigate back to the MONEY_REQUEST_CREATE (START) route instead of targeting MONEY_REQUEST_STEP_CONFIRMATION. This could be done by using handleGoBack() (which calls Navigation.goBack(backTo)) similar to how handleRegularReportSelection works, rather than constructing a new STEP_CONFIRMATION route.

    2. Align isFromGlobalCreate definition: Make IOURequestStepReport.tsx:61 consistent with IOURequestStepConfirmation.tsx:382 by also including isFromFloatingActionButton in the check: const isFromGlobalCreate = !!transaction?.isFromGlobalCreate || !!transaction?.isFromFloatingActionButton.

    3. Fix report display mismatch (Bug 1): In ReportField.tsx, the fallback chain at lines 70-82 should be aligned with how IOURequestStepReport.tsx resolves the selected report. When transaction.reportID is a workspace chat and not outstanding, both components should agree on which outstanding report to display (e.g., the first available one from availableOutstandingReports).

    What alternative solutions did you explore?

    An alternative for Bug 2 would be to add the newManualExpenseFlow beta check as a condition in handleGlobalCreateReport to branch into handleGoBack() when the confirmation is embedded. However, the cleaner fix is to make the global create path use the same backTo pattern as regular selection, since backTo already correctly points to the START page in the new flow.


    Next Steps for Contributor+ team: Reply with @MelvinBot implement this to create a draft PR, @MelvinBot <your feedback> to refine this analysis, or explain why you are rejecting Melvin's proposal.

  7. ChavdaSachin commented on May 14, 2026

    @ChavdaSachin
    Contributor

    NAB: only happens on the beta accounts.

  8. removed
    DeployBlockerCash
    on May 14, 2026
  9. 19 remaining items

  10. added
    Awaiting Payment
    on Jun 1, 2026
  11. melvin-bot commented on Jun 1, 2026

    @melvin-bot

    Triggered auto assignment to @mallenexpensify (Awaiting Payment)

  12. melvin-bot commented on Jun 1, 2026

    @melvin-bot

    Payment Summary

    Upwork Job

    BugZero Checklist (@mallenexpensify)

    • I have verified the correct assignees and roles are listed above and updated the necessary manual offers
    • I have verified that there are no duplicate or incorrect contracts on Upwork for this job (https://www.upwork.com/ab/applicants//hired)
    • I have verified the PR was not reverted
    • I have applied any discounts due to bugs/regressions introduced by this PR
    • I have paid out the Upwork contracts or cancelled the ones that are incorrect
    • I have verified the payment summary above is correct
  13. mallenexpensify commented on Jun 3, 2026

    @mallenexpensify
    Contributor

    Payment Summary

    Contributor: @dukenv0307 due $250 via NewDot

  14. ChavdaSachin commented on Jun 3, 2026

    @ChavdaSachin
    Contributor

    This was a regression from my own PR - #91004
    I am not due payment here.
    My payment would be handled at #82586 at the end

  15. dukenv0307 commented on Jun 5, 2026

    @dukenv0307
    Contributor

    I'll get paid here

  16. mallenexpensify commented on Jun 5, 2026

    @mallenexpensify
    Contributor

    @dukenv0307 paid, summary updated above. Thx.

  17. quinthar commented on Jun 13, 2026

    @quinthar
    Contributor

    Approved $250 to @dukenv0307

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

Metadata

Metadata

Labels

Awaiting PaymentBugDailyEngineering

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions