Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[$250] Migrated User Modal shows twice #58047

Open
1 of 8 tasks
m-natarajan opened this issue Mar 8, 2025 · 7 comments
Open
1 of 8 tasks

[$250] Migrated User Modal shows twice #58047

m-natarajan opened this issue Mar 8, 2025 · 7 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors

Comments

@m-natarajan
Copy link

m-natarajan commented Mar 8, 2025

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Version Number:
Reproducible in staging?: Needs Reproduction
Reproducible in production?: Needs Reproduction
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?:
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: @ishpaul777
Slack conversation (hyperlinked to channel name): #Expensift Bugs

Action Performed:

Pre-requisite:
Have a olddot account, that is nudge migrated to NewDot and has not used in NewDot yet

  1. Sign-in to expensify.com with the account
  2. Get redirected to new.expensify.com
  3. Observe the migration modal appears
  4. Reload the page
  5. Observe the migration modal appears
  6. Dismiss the modal

Expected Result:

Modal is dismissed

Actual Result:

Modal is dismissed, and there is another same modal below it

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android: Standalone
  • Android: HybridApp
  • Android: mWeb Chrome
  • iOS: Standalone
  • iOS: HybridApp
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence
Screen.Recording.2025-03-07.at.12.39.02.AM.mov

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021899129692713005008
  • Upwork Job ID: 1899129692713005008
  • Last Price Increase: 2025-03-10
Issue OwnerCurrent Issue Owner: @
@m-natarajan m-natarajan added Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Needs Reproduction Reproducible steps needed retest-weekly Apply this label if you want this issue tested on a Weekly basis by Applause labels Mar 8, 2025
Copy link

melvin-bot bot commented Mar 8, 2025

Triggered auto assignment to @slafortune (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.

@MelvinBot
Copy link

This has been labelled "Needs Reproduction". Follow the steps here: https://stackoverflowteams.com/c/expensify/questions/16989

@ishpaul777
Copy link
Contributor

ishpaul777 commented Mar 8, 2025

I can reproduce, i have a migrated olddot account from previous project i worked on #migrate, please assign me as per https://expensify.slack.com/archives/C02NK2DQWUX/p1741396625806939

@truph01
Copy link
Contributor

truph01 commented Mar 8, 2025

Proposal

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

  • Migrated User Modal shows twice.

What is the root cause of that problem?

  • When the user is on the /onboarding/migrated-user-welcome route and refreshes the page, the initial state in the here returns undefined. This triggers the default behavior, which opens the Migrated User Modal.

  • Additionally, there is another logic in here that also navigates the user to the Migrated User Modal.

  • As a result, two instances of the Migrated User Modal are displayed simultaneously.

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

  • We can skip this if block if the current route is already /onboarding/migrated-user-welcome. it can be updated to:
            if (hasBeenAddedToNudgeMigration && !dismissedProductTraining?.migratedUserWelcomeModal && !Navigation.getActiveRoute().includes(ROUTES.MIGRATED_USER_WELCOME_MODAL)) {
  • Or we can skip the above if block if the initialUrl is ROUTES.MIGRATED_USER_WELCOME_MODAL instead.

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

  • We should navigate the user to ROUTES.MIGRATED_USER_WELCOME_MODAL. Next, render the useOnboardingFlowRouter hook and ensure that the call to Navigation.navigate with the parameter ROUTES.MIGRATED_USER_WELCOME_MODAL does not occur.

What alternative solutions did you explore? (Optional)

  • One option is to override the default state in the initial state here when the initialUrl is ROUTES.MIGRATED_USER_WELCOME_MODAL. This would prevent the user from accessing the migrated user modal via a deep link, ensuring that the modal can only be opened through the logic in the useOnboardingFlowRouter hook:
  • First, update:

const initialState = useMemo(() => {

    const initialState = useMemo(() => {
        const path = initialUrl ? getPathFromURL(initialUrl) : null;
        if (path?.includes(ROUTES.MIGRATED_USER_WELCOME_MODAL);) {
            return getAdaptedStateFromPath(lastVisitedPath, linkingConfig.config);
        }
  • Then add SCREENS.MIGRATED_USER_WELCOME_MODAL.ROOT to EXCLUDE_FROM_LAST_VISITED_PATH to make sure the migrated user modal is not saved as last visited path.

@melvin-bot melvin-bot bot added the Overdue label Mar 10, 2025
@melvin-bot melvin-bot bot removed the Overdue label Mar 10, 2025
@slafortune slafortune added External Added to denote the issue can be worked on by a contributor Overdue and removed Needs Reproduction Reproducible steps needed retest-weekly Apply this label if you want this issue tested on a Weekly basis by Applause labels Mar 10, 2025
Copy link

melvin-bot bot commented Mar 10, 2025

Job added to Upwork: https://www.upwork.com/jobs/~021899129692713005008

@melvin-bot melvin-bot bot changed the title Migrated User Modal shows twice [$250] Migrated User Modal shows twice Mar 10, 2025
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Mar 10, 2025
Copy link

melvin-bot bot commented Mar 10, 2025

Current assignee @ishpaul777 is eligible for the External assigner, not assigning anyone new.

@neil-marcellini
Copy link
Contributor

Assigning myself to review when the time comes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors
Projects
Status: No status
Development

No branches or pull requests

6 participants