Skip to content

[Payment 2025-12-15] [$250] Onboarding – Continue button not responding after back from work email verification #75863

Closed

Description

@mitarachim

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.2.62-2
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from BrowserStack: KI retest #74295
Email or phone of affected tester (no customers): Amy new gmail account
Issue reported by: Applause Internal Team
Device used: Mac / Safari
App Component: Search

Action Performed:

  1. Sign up with a new Gmail account.
  2. Add your work email when prompted — the verification page will appear.
  3. Click the back arrow.
  4. Enter any name and click Continue.

Expected Result:

Name should be accepted, next page should be displayed

Actual Result:

Continue button is not responding.

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

Bug7011169_1763849034761.1_57_PM_2025-11-22.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021993528272484606590
  • Upwork Job ID: 1993528272484606590
  • Last Price Increase: 2025-11-26
  • Automatic offers:
    • huult | Reviewer | 109617839
Issue OwnerCurrent Issue Owner: @strepanier03

Activity

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

    @melvin-bot

    Triggered auto assignment to @strepanier03 (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. ryntgh commented on Nov 24, 2025

    @ryntgh
    Contributor

    Proposal

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

    Onboarding – Continue button not responding after back from work email verification

    What is the root cause of that problem?

    When navigating back from the work email verification page to the personal details page, onboardingPurposeSelected value is undefined. When the user clicks Continue, the handleSubmit function calls completeOnboarding, which returns early if onboardingPurposeSelected is undefined

    const completeOnboarding = useCallback(
    (firstName: string, lastName: string) => {
    if (!onboardingPurposeSelected) {
    return;
    }

    const handleSubmit = useCallback(
    (values: FormOnyxValues<'onboardingPersonalDetailsForm'>) => {
    const firstName = values.firstName.trim();
    const lastName = values.lastName.trim();
    setDisplayName(firstName, lastName, formatPhoneNumber, session?.accountID ?? CONST.DEFAULT_NUMBER_ID, session?.email ?? '');
    clearPersonalDetailsDraft();
    setPersonalDetails(firstName, lastName);
    if (isPrivateDomainAndHasAccessiblePolicies && (!onboardingPurposeSelected || isVsb || isSmb)) {
    const nextRoute = isValidated ? ROUTES.ONBOARDING_WORKSPACES : ROUTES.ONBOARDING_PRIVATE_DOMAIN;
    Navigation.navigate(nextRoute.getRoute(route.params?.backTo));
    return;
    }
    if (onboardingPurposeSelected === CONST.ONBOARDING_CHOICES.PERSONAL_SPEND || onboardingPurposeSelected === CONST.ONBOARDING_CHOICES.TRACK_WORKSPACE) {
    updateDisplayName(firstName, lastName, formatPhoneNumber, session?.accountID ?? CONST.DEFAULT_NUMBER_ID, session?.email ?? '');
    Navigation.navigate(ROUTES.ONBOARDING_WORKSPACE.getRoute(route.params?.backTo));
    return;
    }
    completeOnboarding(firstName, lastName);
    },

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

    We can check if onboardingPurposeSelected is undefined before calling completeOnboarding, and if it is, we can navigate to the purpose page to allow the user to select a purpose

                if (!onboardingPurposeSelected) {
                    Navigation.navigate(ROUTES.ONBOARDING_PURPOSE.getRoute(route.params?.backTo));
                    return;
                }
    
                completeOnboarding(firstName, lastName);

    if (onboardingPurposeSelected === CONST.ONBOARDING_CHOICES.PERSONAL_SPEND || onboardingPurposeSelected === CONST.ONBOARDING_CHOICES.TRACK_WORKSPACE) {
    updateDisplayName(firstName, lastName, formatPhoneNumber, session?.accountID ?? CONST.DEFAULT_NUMBER_ID, session?.email ?? '');
    Navigation.navigate(ROUTES.ONBOARDING_WORKSPACE.getRoute(route.params?.backTo));
    return;
    }
    completeOnboarding(firstName, lastName);
    },

    What alternative solutions did you explore? (Optional)

    We can navigate to ROUTES.ONBOARDING_PURPOSE when going back from the work email verification page

    function updateOnboardingValuesAndNavigation(onboardingValues: Onboarding | undefined) {
        Onyx.set(ONYXKEYS.NVP_ONBOARDING, {...onboardingValues, shouldValidate: undefined});
    
        Navigation.setNavigationActionToMicrotaskQueue(() => {
            Navigation.navigate(ROUTES.ONBOARDING_PURPOSE.getRoute());
        });
    }

    function updateOnboardingValuesAndNavigation(onboardingValues: Onboarding | undefined) {
    Onyx.set(ONYXKEYS.NVP_ONBOARDING, {...onboardingValues, shouldValidate: undefined});
    // We need to have the Onyx values updated before navigating back
    // Because we navigate based no useEffect logic and we need to clear `shouldValidate` value before going back
    Navigation.setNavigationActionToMicrotaskQueue(() => {
    Navigation.goBack(ROUTES.ONBOARDING_WORK_EMAIL.getRoute());
    });
    }

  4. tsa321 commented on Nov 25, 2025

    @tsa321
    Contributor

    Proposal

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

    User cannot continue after back from onboarding work email verification. Instead of going back to the previous page, it redirects to the Personal Details page.

    What is the root cause of that problem?

    I think the page flow, when the user presses the Back button on the Validate Work Email page, should return to the Work Email onboarding page.

    In here:

    onBackButtonPress={() => {
    const routeToNavigate = (route.params?.backTo as Route) ?? ROUTES.ONBOARDING_PERSONAL_DETAILS.getRoute();
    Navigation.goBack(routeToNavigate);

    After the user presses the Back button on the email validation page, the navigation goes to ONBOARDING_PERSONAL_DETAILS. I believe this is incorrect; it should go back to the work-email page.

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

    Change the destination to ONBOARDING_WORK_EMAIL page.

    After setting it, we also need to change some Onyx onboarding values so the page won’t automatically redirect to the validation page because of this useEffect:

    useEffect(() => {
    if (onboardingValues?.shouldValidate === undefined && onboardingValues?.isMergeAccountStepCompleted === undefined) {
    return;
    }
    setOnboardingErrorMessage(null);
    if (onboardingValues?.shouldValidate) {
    Navigation.navigate(ROUTES.ONBOARDING_WORK_EMAIL_VALIDATION.getRoute());
    return;
    }
    // Once we verify that shouldValidate is false, we need to force replace the screen
    // so that we don't navigate back on back button press
    if (isVsb) {
    Navigation.navigate(ROUTES.ONBOARDING_ACCOUNTING.getRoute(), {forceReplace: true});
    return;
    }
    if (isSmb) {
    Navigation.navigate(ROUTES.ONBOARDING_EMPLOYEES.getRoute(), {forceReplace: true});
    return;
    }
    if (!onboardingValues?.isMergeAccountStepSkipped) {
    Navigation.navigate(ROUTES.ONBOARDING_PRIVATE_DOMAIN.getRoute(), {forceReplace: true});
    return;
    }
    Navigation.navigate(ROUTES.ONBOARDING_PURPOSE.getRoute(), {forceReplace: true});
    }, [onboardingValues?.shouldValidate, isVsb, isSmb, isFocused, onboardingValues?.isMergeAccountStepCompleted, onboardingValues?.isMergeAccountStepSkipped]);

    The code forces the private-domain/email validation page to be displayed,
    so we need to change some Onyx onboarding values.

    When user addWorkMail:

    const successData: OnyxUpdate[] = [
    {
    onyxMethod: Onyx.METHOD.MERGE,
    key: ONYXKEYS.FORMS.ONBOARDING_WORK_EMAIL_FORM,
    value: {
    isLoading: false,
    },
    },
    ];

    on the success data we need to add:

    {
                onyxMethod: Onyx.METHOD.MERGE,
                key: ONYXKEYS.NVP_ONBOARDING,
                value: {
                     isMergeAccountStepCompleted: false,
                     isMergeAccountStepSkipped: false
                },
            },

    Then add condition in here:

    if (onboardingValues?.isMergeAccountStepCompleted === undefined) { 
         return;
    }

    and reset/remove the isMergeAccountStepCompleted to be undefined when user press the goBack button in the email validation page:

    const routeToNavigate = (route.params?.backTo as Route) ?? ROUTES.ONBOARDING_PERSONAL_DETAILS.getRoute();

    resetOnboardingMergeAccountStepValue(onboardingValues) to make the isMergeAccountStepCompleted to be undefined.
    Then also check on the onboarding work email validation page.

    Result:
    test_d.mp4

    What alternative solutions did you explore? (Optional)

    Instead of using isMergeAccountStepCompleted as a boolean, we could change it to an enum type (for example, InsertEmailStep and ValidateEmailStep) to make the merge account steps clearer.

    Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.

  5. strepanier03 commented on Nov 26, 2025

    @strepanier03
    Contributor

    Able to repro, moving forward.

  6. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Nov 26, 2025
  7. changed the title [-]Onboarding – Continue button not responding after back from work email verification[/-] [+][$250] Onboarding – Continue button not responding after back from work email verification[/+] on Nov 26, 2025
  8. melvin-bot commented on Nov 26, 2025

    @melvin-bot
  9. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Nov 26, 2025
  10. melvin-bot commented on Nov 26, 2025

    @melvin-bot

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

  11. AlbadawiDev commented on Nov 26, 2025

    @AlbadawiDev

    Hi, here is my proposal for fixing this issue.

    Summary

    During onboarding, if the user adds a work email and is taken to the verification screen, then uses the back arrow and fills in the “What’s your name?” step, the Continue button no longer responds.

    This suggests the onboarding modal visually moved to the name step, but the internal state that drives the CTA is still tied to the previous “verify work email” step or to a pending verification state, so the Continue handler is disabled or short-circuited.

    Root cause hypothesis

    Based on this flow and similar onboarding/back issues:

    Onboarding uses a shared state (likely stored in Onyx) to track:

    Current step (work email → verify work email → name → …)

    Pending actions like work email verification

    Flags that control whether the primary button is enabled and what it does.

    When the user:

    Signs up with a public email (Gmail)

    Adds a work email and navigates to the verification page

    Presses the back arrow

    Ends up on the “What’s your name?” modal and clicks Continue

    the modal route changes, but one or more of these things is not reset:

    The “verify work email” step is still considered active or required

    A “submit in progress / waiting for verification” flag remains true

    The resolver that decides the CTA behaviour still expects the verification step before allowing the name step to continue

    As a result, the Continue button on the name step either:

    Remains disabled because the guard condition never becomes valid

    Or fires a handler that immediately returns because it thinks the prerequisite (work email verification) is incomplete or in a blocking state.

    This explains why the UI shows the name modal but the button does nothing across all platforms.

    Implementation plan

    1. Audit the onboarding step state and CTA enabling logic

    Locate the onboarding modal component that drives:

    “What’s your work email?”

    “Verify your work email”

    “What’s your name?”

    Identify:

    The enum or constants used for the current step

    The state/Onyx keys that represent “waiting for work email verification” or similar

    The function that decides:

    Which handler is used by the primary button for each step

    When the button is enabled or disabled

    Goal: clearly see what is supposed to happen when moving from “verify work email” back to the “name” step.

    1. Make the back action from the verification screen reset blocking flags

    Update the back handler on the “verify your work email” screen so that, in addition to changing the visible step, it also clears any verification-specific blocking state.

    For example (pseudocode):

    When navigating back from the verification page:

    Set currentOnboardingStep = NAME_STEP

    Reset flags like:

    isVerifyingWorkEmail = false

    pendingWorkEmailVerification = null (if present)

    Any “must complete this verification before proceeding” flag that influences the CTA

    This ensures the onboarding “state machine” is aligned with what the user sees: after pressing back, we are on the name step and are not blocked by a stale verification state.

    1. Decouple the “name” step CTA from the verification state

    In the logic that defines whether the Continue button is enabled on the “What’s your name?” modal:

    Ensure the button enabled state depends only on:

    Name fields being valid (non-empty, trimmed, etc.)

    No local submit in progress for the name itself

    Avoid tying the name step’s CTA enablement directly to a flag that says “verification page is active” or “waiting for work email verification to finish”.

    Concretely:

    For the name step:

    Primary button handler should always:

    Save the name details

    Advance to the next onboarding step

    isDisabled for the CTA on this step should not depend on verification-only flags.

    If there is a global guard that says “don’t advance until the work email state is consistent”, scope that guard so it does not affect the name step in this specific back-from-verification scenario.

    1. Ensure step transitions are symmetrical

    When going forward:

    Work email → verify work email → name

    When going backward:

    Verify work email → name should:

    Set currentStep = NAME

    Clear any “verify page” locks

    If there is a shared navigation helper for onboarding steps, add explicit handling for the path:

    VERIFICATION_STEP → NAME_STEP

    Add inline comments near this logic to explain:

    Why we reset verification flags when going back

    That the name step must always have a responsive CTA once the user sees it

    This reduces the chance of reintroducing similar bugs if new onboarding rules are added.

    Testing plan

    I will test on staging with the exact steps from the report and some extra variations:

    Repro flow (all platforms)

    Sign up with a new Gmail account.

    Add a work email when prompted.

    On the verification page, click the back arrow.

    Enter any name on the “What’s your name?” modal.

    Click Continue.

    Confirm:

    Continue responds immediately.

    The next onboarding page appears.

    The button does not get stuck or become unresponsive.

    Control flow without going back

    Sign up with a new Gmail account.

    Add a work email and complete the verification.

    Continue through the name step as usual.

    Confirm there are no regressions in the standard onboarding path.

    Flow with skipping work email (if applicable)

    Sign up with a new Gmail account.

    Skip adding a work email if that option is present.

    Go through the name step and subsequent steps.

    Confirm the CTA behaves normally.

    Cross-platform checks
    Repeat the repro flow on:

    MacOS: Safari and Chrome

    Windows: Chrome

    iOS: App and mWeb (Safari/Chrome)

    Android: App and mWeb Chrome

    For each platform, verify:

    The Continue button on “What’s your name?” responds as expected after backing out of the verification page.

    There is no unexpected jump back to earlier onboarding steps.

    If this proposal is approved, I’ll implement the changes in a fork, open a PR with code, attach a short test matrix with the platforms I verified, and include any relevant screenshots of the fixed onboarding flow.

  12. KocaPepsi commented on Nov 26, 2025

    @KocaPepsi
    Contributor

    Proposal

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

    Continue button not responding after back from work email verification

    What is the root cause of that problem?

    I believe this issue originates from this PR: #73823.

    Before this PR, when going back from the private domain onboarding flow, the modal would close. This is because we now use replace with forceReplace: true.

    if (!onboardingValues?.isMergeAccountStepSkipped) {
    Navigation.navigate(ROUTES.ONBOARDING_PRIVATE_DOMAIN.getRoute(), {forceReplace: true});
    return;
    }

    and Before this PR, we only used Navigation.goBack().

    After applying this PR (#73823), the flow was changed so that it now navigates to the personal onboarding screen to handle other cases

    onBackButtonPress={() => {
    const routeToNavigate = (route.params?.backTo as Route) ?? ROUTES.ONBOARDING_PERSONAL_DETAILS.getRoute();
    Navigation.goBack(routeToNavigate);
    }}

    I think navigating to the personal onboarding screen here is not correct in the private domain case.

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

    We should restore the original back-navigation behavior for the private domain flow. Instead of navigating to the personal onboarding screen, the back action should simply close the modal or return to the previous step.

    onBackButtonPress={() => {
    const routeToNavigate = (route.params?.backTo as Route) ?? ROUTES.ONBOARDING_PERSONAL_DETAILS.getRoute();
    Navigation.goBack(routeToNavigate);
    }}

    replace to:

      onBackButtonPress={() => {
        if (route.params?.backTo) {
            Navigation.goBack(route.params?.backTo as Route);
            return;
        }
    
        if (onboardingPersonalDetailsForm?.firstName || onboardingPersonalDetailsForm?.lastName) {
            const routeToNavigate = ROUTES.ONBOARDING_PERSONAL_DETAILS.getRoute();
            Navigation.goBack(routeToNavigate);
            return;
        }
    
        Navigation.goBack();
    }}

    What alternative solutions did you explore? (Optional)

    If we want to go back to the Add Workspace Email screen, then we should handle it like this.

    onBackButtonPress={() => {
    const routeToNavigate = (route.params?.backTo as Route) ?? ROUTES.ONBOARDING_PERSONAL_DETAILS.getRoute();
    Navigation.goBack(routeToNavigate);
    }}

    replace to:

        onBackButtonPress={() => {
              if (route.params?.backTo) {
                  Navigation.goBack(route.params?.backTo as Route);
                  return;
              }
    
              if (onboardingPersonalDetailsForm?.firstName || onboardingPersonalDetailsForm?.lastName) {
                  const routeToNavigate = ROUTES.ONBOARDING_PERSONAL_DETAILS.getRoute();
                  Navigation.goBack(routeToNavigate);
                  return;
              }
    
              updateOnboardingValuesAndNavigation(onboardingValues);
          }}

    Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.

    Video demo after the issue is resolved.

    1_1.mp4
  13. 11 remaining items

  14. KocaPepsi commented on Nov 27, 2025

    @KocaPepsi
    Contributor

    I have updated proposal

    • Added a solution in case we want to navigate back to the Add Work Email screen
  15. huult commented on Nov 27, 2025

    @huult
    Contributor

    @tsa321 Thanks for the question. We will ask the product team during the PR phase. If they agree with changing this behavior, we will update it. It seems that @KocaPepsi has added a solution to handle the case of navigating back to the Add Work Email screen, which looks correct and doesn't require introducing new optimistic data.

    @KocaPepsi could you provide an ETA for your PR?

  16. KocaPepsi commented on Dec 2, 2025

    @KocaPepsi
    Contributor

    Hi @strepanier03, @flodnv

    It seems Upwork is unable to create a contract for me. I don’t see any Upwork contract on my side on the Upwork page

  17. huult commented on Dec 6, 2025

    @huult
    Contributor

    This was deployed to production already, and the payout date must be updated.

  18. huult commented on Dec 11, 2025

    @huult
    Contributor

    @strepanier03 This issue is ready for payment.

  19. huult commented on Dec 15, 2025

    @huult
    Contributor

    BugZero Checklist:

    • [Contributor] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.

      Link to comment: https://github.com/Expensify/App/pull/73823/changes#r2617727489

    • [Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.

      Link to discussion: N/A

    • [Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.

    • Yes

    Regression Test Proposal Template
    • [BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.

      Link to issue:

    Regression Test Proposal

    Precondition:

    • N/A

    Test:

    1. Open the Expensify app.
    2. Sign up with a new Gmail account.
    3. Add your work email in the Work Email input during onboarding (e.g., company+9239424@company.com).
    4. Click the Add Work Email button.
    5. Click the back arrow icon on the Onboarding Private Email screen.
    6. Verify that Add Work Email appears after tapping the back arrow on the Onboarding Private Email screen.

    Do we agree 👍 or 👎

  20. strepanier03 commented on Dec 15, 2025

    @strepanier03
    Contributor

    Payment Summary

  21. changed the title [-][$250] Onboarding – Continue button not responding after back from work email verification[/-] [+][Payment 2025-12-15] [$250] Onboarding – Continue button not responding after back from work email verification[/+] on Dec 15, 2025
  22. huult commented on Dec 17, 2025

    @huult
    Contributor

    I accepted your offer.

  23. strepanier03 commented on Dec 18, 2025

    @strepanier03
    Contributor

    Nice, all set. I paid and closed the contract.

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

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.ExternalAdded to denote the issue can be worked on by a contributorReviewingHas a PR in reviewWeeklyKSv2

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions