Skip to content

[Due for payment 2025-10-13] [$250] Onboarding - Navigating back from the #admins chat redirects to the Workspaces page #70179

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.2.3-0
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from TestRail: #69620
Email or phone of affected tester (no customers): biruknew45ss@gmail.com
Issue reported by: Applause Internal Team
Device used: android
App Component: Other

Action Performed:

  1. Go to https://staging.new.expensify.com/
  2. Signup with email that should not contain "+"
  3. Choose Track and budget expenses
  4. Create workspace and complete and onboarding flow
  5. After completing the onboarding flow, you are automatically taken to the #admins room.
  6. Click the back navigation from the #admins room.

Expected Result:

Clicking the back navigation should return to LHN

Actual Result:

Clicking the back navigation redirects to the Workspaces page

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

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021965449221653042953
  • Upwork Job ID: 1965449221653042953
  • Last Price Increase: 2025-09-09
  • Automatic offers:
    • gijoe0295 | Contributor | 108802625
Issue OwnerCurrent Issue Owner: @isabelastisser

Activity

  1. added
    Daily
    Bug
    on Sep 9, 2025
  2. melvin-bot commented on Sep 9, 2025

    @melvin-bot

    Triggered auto assignment to @isabelastisser (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. gijoe0295 commented on Sep 9, 2025

    @gijoe0295
    Contributor

    🚨 Edited by proposal-police: This proposal was edited at 2025-09-10 06:08:31 UTC.

    Proposal

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

    Navigating back from the #admins chat redirects to the Workspaces page

    What is the root cause of that problem?

    const skipTestDrive = () => {
    Log.hmmm('[AdminTestDriveModal] Skip test drive function called');
    Navigation.dismissModal();
    Log.hmmm('[AdminTestDriveModal] Running after interactions');
    InteractionManager.runAfterInteractions(() => {
    if (!isAdminRoom(onboardingReport)) {
    Log.hmmm('[AdminTestDriveModal] Not an admin room');
    return;
    }
    Log.hmmm('[AdminTestDriveModal] Navigating to report', {reportID: onboardingReport?.reportID});
    Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(onboardingReport?.reportID));
    });
    };

    We're dismissing the modal before navigating to the admins room report. But there might be race condition (due to the indeterministic nature of InteractionManager.runAfterInteractions) that causes navigate to take place before the modal is completely dismissed. The log below clearly says that we're navigating before handling the dismiss modal action:

    Image

    So the navigation state at this point is: ReportsSplitNavigator (LHN) > TestDriveModalNavigator > ReportsSplitNavigator (ReportScreen). The dismiss modal action is not handled until that time. Inside handleDismissModalAction we have a check for whether the last route is a modal, if it's not, we won't execute the dismissal:

    if (!lastRoute?.name || !MODAL_ROUTES_TO_DISMISS.includes(lastRoute?.name)) {
    Log.hmmm('[Navigation] dismissModal failed because there is no modal stack to dismiss');
    return null;

    We can see that at this point the last route is the ReportsSplitNavigator which is not a modal so dismissal is not executed, and the eventual navigation state is: ReportsSplitNavigator (LHN) > TestDriveModalNavigator > ReportsSplitNavigator (ReportScreen).

    So later when we navigate back from the admin room, the navigation state is ReportsSplitNavigator (LHN) > TestDriveModalNavigator, so we go back to the test drive modal navigator which now does not show because the modal visibility had been set to false. So it shows a random page which is the WorkspacesListPage. I'm not sure the exact reason why it's the WorkspacesListPage but not others.

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

    We should use dismissModalWithReport instead. This must be used for cases where we open the report after dismissing modal.

    const skipTestDrive = () => {
        InteractionManager.runAfterInteractions(() => {
            if (!onboardingReport || !isAdminRoom(onboardingReport)) {
                Navigation.dismissModal();
                return;
            }
    
            Navigation.dismissModalWithReport({reportID: onboardingReport.reportID});
        });
    };

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

    None

    What alternative solutions did you explore? (Optional)

    None

  4. added
    External
    Help Wanted
    on Sep 9, 2025
  5. changed the title [-]Onboarding - Navigating back from the #admins chat redirects to the Workspaces page[/-] [+][$250] Onboarding - Navigating back from the #admins chat redirects to the Workspaces page[/+] on Sep 9, 2025
  6. melvin-bot commented on Sep 9, 2025

    @melvin-bot
  7. melvin-bot commented on Sep 9, 2025

    @melvin-bot

    Triggered auto assignment to Contributor-plus team member for initial proposal review - @jayeshmangwani (External)

  8. marufsharifi commented on Sep 10, 2025

    @marufsharifi
    Contributor

    🚫 Duplicated proposal withdrawn by 🤖 ProposalPolice.

  9. github-actions commented on Sep 10, 2025

    @github-actions
    Contributor

    ⚠️ @marufsharifi Your proposal is a duplicate of an already existing proposal and has been automatically withdrawn to prevent spam. Please review the existing proposals before submitting a new one.

  10. marufsharifi commented on Sep 10, 2025

    @marufsharifi
    Contributor

    Proposal

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

    What is the root cause of that problem?

    The redirection to Workspaces_List occurs because the navigate call in skipTestDrive creates a duplicate ReportsSplitNavigator due to a timing issue with modal dismissal, resulting in an inconsistent navigation stack state. When goBack() is called, the stack unwinds through the invalid modal and initial navigator, and React Navigation’s fallback mechanism redirects to the preloaded Workspaces_List route, which is the last preloaded route as a safe default.

    Log.hmmm('[AdminTestDriveModal] Skip test drive function called');
    Navigation.dismissModal();
    Log.hmmm('[AdminTestDriveModal] Running after interactions');
    InteractionManager.runAfterInteractions(() => {
    if (!isAdminRoom(onboardingReport)) {
    Log.hmmm('[AdminTestDriveModal] Not an admin room');
    return;
    }
    Log.hmmm('[AdminTestDriveModal] Navigating to report', {reportID: onboardingReport?.reportID});
    Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(onboardingReport?.reportID));
    });

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

    Make sure the modal is fully dismissed before navigating to the admin report page. Replace InteractionManager.runAfterInteractions with Navigation.isNavigationReady() to ensure navigation happens at the right time.

    InteractionManager.runAfterInteractions(() => {
    if (!isAdminRoom(onboardingReport)) {
    Log.hmmm('[AdminTestDriveModal] Not an admin room');
    return;
    }
    Log.hmmm('[AdminTestDriveModal] Navigating to report', {reportID: onboardingReport?.reportID});
    Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(onboardingReport?.reportID));
    });

    Update to

       Navigation.isNavigationReady().then(() => {
                if (!isAdminRoom(onboardingReport)) {
                    Log.hmmm('[AdminTestDriveModal] Not an admin room');
                    return;
                }
    
                            Log.hmmm('[AdminTestDriveModal] Navigating to report', {reportID: onboardingReport?.reportID});
                Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(onboardingReport?.reportID));
            });

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

    None

    What alternative solutions did you explore? (Optional)

    As a workaround, use dismissModalWithReport, which leverages forceReplace to navigate to the report page.

    const dismissModalWithReport = ({reportID, reportActionID, referrer, backTo}: ReportsSplitNavigatorParamList[typeof SCREENS.REPORT], ref = navigationRef) => {
    isNavigationReady().then(() => {
    const topmostReportID = getTopmostReportId();
    const areReportsIDsDefined = !!topmostReportID && !!reportID;
    const isReportsSplitTopmostFullScreen = ref.getRootState().routes.findLast((route) => isFullScreenName(route.name))?.name === NAVIGATORS.REPORTS_SPLIT_NAVIGATOR;
    if (topmostReportID === reportID && areReportsIDsDefined && isReportsSplitTopmostFullScreen) {
    dismissModal();
    return;
    }
    const reportRoute = ROUTES.REPORT_WITH_ID.getRoute(reportID, reportActionID, referrer, backTo);
    if (getIsNarrowLayout()) {
    navigate(reportRoute, {forceReplace: true});
    return;
    }

  11. 28 remaining items

  12. removed
    Reviewing
    on Oct 6, 2025
  13. melvin-bot commented on Oct 6, 2025

    @melvin-bot

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

  14. melvin-bot commented on Oct 6, 2025

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.2.23-3 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-10-13. 🎊

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

  15. melvin-bot commented on Oct 6, 2025

    @melvin-bot

    @jayeshmangwani @isabelastisser 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]

  16. gijoe0295 commented on Oct 7, 2025

    @gijoe0295
    Contributor

    @MarioExpensify @isabelastisser QA said they can still reproduce the original issue #71822 (comment) but I can not. Can we ask them to retest here and attach recordings if it's still reproducible for them?

  17. gijoe0295 commented on Oct 7, 2025

    @gijoe0295
    Contributor

    Oh I just saw @jayeshmangwani comment on Slack so it's not related to our PR, right?

  18. jayeshmangwani commented on Oct 7, 2025

    @jayeshmangwani
    Contributor

    I think that’s correct. It doesn’t seem related to our PR, but let’s check what the QAs are experiencing.

  19. added
    Daily
    and removed
    Weekly
    on Oct 13, 2025
  20. gijoe0295 commented on Oct 13, 2025

    @gijoe0295
    Contributor

    I think payment is due here @isabelastisser

  21. isabelastisser commented on Oct 15, 2025

    @isabelastisser
    Contributor

    Payment summary:

    @jayeshmangwani requires payment through NewDot Manual Requests $250 for C+ review
    @gijoe0295 paid in Upwork $250 automatic offer (Contributor)

  22. isabelastisser commented on Oct 15, 2025

    @isabelastisser
    Contributor

    All set!

  23. twisterdotcom commented on Oct 28, 2025

    @twisterdotcom
    Contributor

    @jayeshmangwani has submitted payment for this report on ND here.

    SO: https://stackoverflowteams.com/c/expensify/questions/7582

    Zapier Logs Run ID: 00040eee-2089-af3c-941a-332855489981
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentBugDailyExternal

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions