Skip to content

[Due for payment 2026-06-11] Manual tab shows scan confirm page after uploading receipt on Scan and returning to Manual #90652

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. Click + > Create expense > Scan.
  4. Upload a receipt.
  5. Click RHP back button.
  6. Go to Manual tab.

Expected Result:

Manual tab will not show scan confirm page.

Actual Result:

Manual tab shows scan confirm page after uploading receipt on Scan and returning to Manual.

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: @mallenexpensify

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 fixed)

    Recommendation: REVERT

    PR #87920 introduced a regression in the newManualExpenseFlow beta: after uploading a receipt on the Scan tab and navigating back, switching to the Manual tab still shows the scan confirm page instead of the manual input form.

    Assigned: @ChavdaSachin (PR author), @ShridharGoel, @puneetlath (approving reviewers) from highest-confidence causing PR only
    Labels: DeployBlockerCash kept (Frontend bug in App PR). No label changes made.

    Details

    Evidence

    • PR Feat: Manual expense flow UI refactor - r3 #87920 changed the CONST.TAB_REQUEST.MANUAL tab in IOURequestStartPage.tsx to render IOURequestStepConfirmation instead of IOURequestStepAmountWithTransactionOnly when isNewManualExpenseFlowEnabled is true.
    • Before this PR, the Manual tab showed the amount entry step, which is entirely independent from the scan flow state.
    • After this PR, the Manual tab now shows the confirmation page (IOURequestStepConfirmation), which determines whether to render the scan confirm UI or the manual input form based on requestType.
    • The requestType is derived from transaction.iouRequestType, which is persisted in the Onyx transaction draft.
    • When a user uploads a receipt on the Scan tab, iouRequestType is set to SCAN in the draft. Clicking the RHP back button does not reset iouRequestType.
    • When the user then switches to the Manual tab, IOURequestStepConfirmation is rendered with the same stale SCAN transaction draft, so requestType === CONST.IOU.REQUEST_TYPE.SCAN.
    • The key logic in IOURequestStepConfirmation.tsx (line 667): const shouldShowSmartScanFields = ... || requestType !== CONST.IOU.REQUEST_TYPE.SCAN; evaluates to false, causing the scan confirmation UI to be shown instead of the manual fields.

    Verification

    • Affected file: src/pages/iou/request/IOURequestStartPage.tsx — PR Feat: Manual expense flow UI refactor - r3 #87920 directly modified this file to embed IOURequestStepConfirmation in the Manual tab.
    • Affected file: src/pages/iou/request/step/IOURequestStepConfirmation.tsx — PR Feat: Manual expense flow UI refactor - r3 #87920 modified this file extensively (229 additions, 35 deletions) including the shouldShowSmartScanFields logic that controls what UI is displayed.
    • The bug is staging-only; this feature (newManualExpenseFlow) does not exist in production, consistent with the report ("Reproducible in production?: N/A - new feature, doesn't exist in prod").

    Root Cause

    When isNewManualExpenseFlowEnabled is active, IOURequestStartPage renders IOURequestStepConfirmation directly in the Manual tab. This confirmation component reads transaction.iouRequestType to determine if it is a scan flow. If a user previously used the Scan tab and uploaded a receipt, the transaction draft retains iouRequestType = SCAN. Switching to the Manual tab renders the same draft through IOURequestStepConfirmation, which then renders the scan confirmation UI because requestType is still SCAN. The Manual tab's embedded confirmation page does not reset or override iouRequestType when the tab changes.

  6. MelvinBot commented on May 14, 2026

    @MelvinBot
    Contributor

    Proposal

    What is the root cause of that problem?

    PR Expensify/App#87920 changed the Manual tab to render IOURequestStepConfirmation (when the newManualExpenseFlow beta is enabled) instead of the previous IOURequestStepAmountWithTransactionOnly. The confirmation component contains a FullScreenLoadingIndicator that renders when isScanRequest(transaction) && !Object.values(receiptFiles).length.

    When switching tabs, resetIOUTypeIfChanged correctly calls initMoneyRequest, which creates a fresh transaction via Onyx.set(). However, Onyx.set() is asynchronous. During the gap before the Onyx update processes, the Manual tab's IOURequestStepConfirmation reads the stale scan transaction (which still has iouRequestType: 'scan' and receipt data). This causes isScanRequest(transaction) to return true, and the FullScreenLoadingIndicator covers the entire Manual tab UI.

    In the receipt-uploaded repro (this issue), the ReceiptFileValidator may also populate receiptFiles from the stale scan data, causing the scan confirmation UI with the receipt image to appear instead of the loading spinner — either way, the Manual tab shows scan-specific content it shouldn't.

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

    In IOURequestStepConfirmation, the scan-specific loading guard should be skipped when the component is rendered inside the Manual tab. The shouldHideHeader prop is already passed exclusively from the Manual tab in IOURequestStartPage, so it can be used to gate this behavior:

    Change the loading condition at line 757 from:

    isScanRequest(transaction) && !Object.values(receiptFiles).length
    

    to:

    !shouldHideHeader && isScanRequest(transaction) && !Object.values(receiptFiles).length
    

    This ensures that when IOURequestStepConfirmation is embedded in the Manual tab (shouldHideHeader === true), it won't show the scan loading indicator even if the transaction hasn't been updated by Onyx yet.

    What alternative solutions did you explore? (Optional)

    An alternative would be to make initMoneyRequest synchronous or add a local "switching" state to suppress rendering until the Onyx update lands. However, Onyx.set() is inherently async, and adding intermediate state flags introduces complexity. Gating the scan-specific UI with shouldHideHeader is minimal and directly prevents the wrong UI from rendering on the Manual tab.

    Related issues & investigation details

    Likely duplicate: Expensify/App#90648 — "Confirm page loads infinitely after switching from Scan to Manual tab" — same root cause, slightly different repro (no receipt upload needed).

    Also related: Expensify/App#87826 — "Tap back button from scanning confirm page return to Manual tab" — similar symptom, predates this PR.

    Key code path:

    1. User uploads receipt on Scan tab → setMoneyRequestReceipt stores receipt data on the transaction draft
    2. User presses back → returns to IOURequestStartPage, transaction draft still has iouRequestType: 'scan' + receipt data
    3. User switches to Manual tab → onTabSelected fires → resetIOUTypeIfChanged('manual') calls initMoneyRequest → Onyx.set() (async)
    4. Manual tab renders IOURequestStepConfirmation which reads stale scan transaction → shows scan UI

    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 in the beta accounts

  8. puneetlath commented on May 14, 2026

    @puneetlath
    Contributor

    Demoting.

  9. 28 remaining items

  10. trjExpensify commented on Jun 5, 2026

    @trjExpensify
    Contributor

    Assigned you.

  11. melvin-bot commented on Jun 8, 2026

    @melvin-bot

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

  12. added
    Awaiting Payment
    on Jun 8, 2026
  13. melvin-bot commented on Jun 10, 2026

    @melvin-bot

    Triggered auto assignment to @mallenexpensify (Awaiting Payment)

  14. melvin-bot commented on Jun 10, 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
  15. mallenexpensify commented on Jun 15, 2026

    @mallenexpensify
    Contributor

    Payment Summary

    Contributor: @dukenv0307 due $250 via NewDot
    Contributor+: @thelullabyy due $250 via NewDot

    I think that's correct, don't think we need a test case cuz that'll likely be taken care of as part of the project.

  16. quinthar commented on Jun 29, 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