Skip to content

[Due for payment 2025-08-26] [Multi-Files Drag-and-Drop] Scan - Scan flow reopens after changing To field to self DM and adding another receipt #65849

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: v9.1.79-2
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from TestRail: #65678
Email or phone of affected tester (no customers): applausetester+daveec13@applause.expensifail.com
Issue reported by: Applause Internal Team
Device used: Mac 14.5/ Chrome
App Component: Money Requests

Action Performed:

Precondition:

Log in with Expensifail account.
Have a workspace (make sure it is the default workspace).

  1. Go to staging.expensify.com
  2. Open FAB > Create expense > Scan.
  3. Upload a receipt.
  4. On confirmation page, click on the To field (workspace chat).
  5. Select Self DM
  6. Click RHP back button.
  7. Upload another receipt.

Expected Result:

Redirected to the confirmation step

Actual Result:

The first step of scan flow reopens, Not redirected to the confirmation step

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

1.mp4

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @stephanieelliott

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Jul 10, 2025
  2. melvin-bot commented on Jul 10, 2025

    @melvin-bot

    Triggered auto assignment to @stephanieelliott (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

  3. koko57 commented on Jul 10, 2025

    @koko57
    Contributor

    ok, please assign me I will check it @mountiny @lakchote

  4. MobileMage commented on Jul 10, 2025

    @MobileMage
    Contributor

    Proposal

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

    The scan flow reopens after changing the "To" field to self DM and adding another receipt, instead of redirecting to the confirmation step as expected. Additionally, I also identified issue where repeatedly selecting recipients creates nested URL parameters, causing the backTo parameter to be encoded multiple times like backTo=%2Fcreate%2Fcreate%2Fparticipants%2F1%2F6535657166461123%3FbackTo%3D%252Fcreate%252Fsubmit%252Fconfirmation%252F1%252F6535657166461123.

    What is the root cause of that problem?

    The root cause is in the navigation logic in IOURequestStepParticipants.tsx. When participants are selected, the code checks if a backTo parameter exists and attempts to navigate back to the previous screen using Navigation.goBack(). However, this approach fails when the flow expects to proceed forward to the confirmation step. The navigation logic incorrectly assumes that having a backTo parameter means we should always go back, but in the scan flow after selecting participants, we should move forward to confirmation regardless of the backTo parameter.

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

    We should update the navigation logic in IOURequestStepParticipants.tsx to always navigate forward to the next step instead of conditionally going back based on the backTo parameter. The fix involves:

    1. Removing the conditional logic that checks for backTo parameter in both navigateToNextStep and navigateToConfirmationStep functions
    2. Always using Navigation.navigate() instead of Navigation.goBack() to ensure forward progression in the flow
    3. Using Navigation.getActiveRouteWithoutParams() instead of Navigation.getActiveRoute() to avoid accumulating URL parameters
    // Before: conditional navigation based on backTo
    if (backTo) {
        Navigation.goBack(route, {compareParams: false});
    } else {
        Navigation.navigate(route);
    }
    
    // After: always navigate forward
    Navigation.navigate(route);

    This ensures the scan flow always progresses forward to the confirmation step as expected, regardless of how the user arrived at the participants screen.

    Before fix

    failed.scan.nav.mp4

    After fix

    fixed.scan.nav.mp4

    What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

    We should test the scan flow navigation from participants selection to confirmation step, ensuring that after selecting a recipient (both workspace and self DM), the user is always taken to the confirmation page. Additionally, test that URL parameters don't accumulate when navigating back and forth between participant selection and confirmation screens.

    What alternative solutions did you explore? (Optional)

    N/A

  5. dmkt9 commented on Jul 11, 2025

    @dmkt9
    Contributor

    I found the root cause for this issue. Can I create a proposal here?

  6. dmkt9 commented on Jul 11, 2025

    @dmkt9
    Contributor

    Ah, I see there’s already an open PR for this issue. The PR’s solution is much more complex than the one I found. It only takes a few lines of code to fix this one.

  7. 57 remaining items

  8. changed the title [-] Scan - Scan flow reopens after changing To field to self DM and adding another receipt[/-] [+][Due for payment 2025-08-26] Scan - Scan flow reopens after changing To field to self DM and adding another receipt[/+] on Aug 19, 2025
  9. melvin-bot commented on Aug 19, 2025

    @melvin-bot

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

  10. melvin-bot commented on Aug 19, 2025

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.96-2 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 2025-08-26. 🎊

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

    • @koko57 does not require payment (Contractor)
    • @shubham1206agra requires payment through NewDot Manual Requests
    • @dmkt9 requires payment (Needs manual offer from BZ)
  11. melvin-bot commented on Aug 19, 2025

    @melvin-bot

    @shubham1206agra @stephanieelliott 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]

  12. melvin-bot commented on Aug 26, 2025

    @melvin-bot

    Payment Summary

    Upwork Job

    • Contributor: @koko57 is from an agency-contributor and not due payment
    • Reviewer: @shubham1206agra owed $250 via NewDot
    • ROLE: @dmkt9 paid $(AMOUNT) via Upwork (LINK)

    BugZero Checklist (@stephanieelliott)

    • 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. stephanieelliott commented on Aug 27, 2025

    @stephanieelliott
    Contributor

    Payment Summary

    Contributor: @dmkt9 due $250 via Upwork
    Contributor+: @shubham1206agra due $250 via NewDot

  14. dmkt9 commented on Aug 27, 2025

    @dmkt9
    Contributor

    @stephanieelliott Thanks. I just requested payment on Upwork.

  15. stephanieelliott commented on Aug 27, 2025

    @stephanieelliott
    Contributor

    All paid! Thanks

  16. trjExpensify commented on Sep 1, 2025

    @trjExpensify
    Contributor

    $250 approved for @shubham1206agra

  17. changed the title [-][Due for payment 2025-08-26] Scan - Scan flow reopens after changing To field to self DM and adding another receipt[/-] [+][Due for payment 2025-08-26] [Multi-Files Drag-and-Drop] Scan - Scan flow reopens after changing To field to self DM and adding another receipt[/+] on Jan 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions