Skip to content

[Due for payment 2026-07-17] [$250] Onboarding - Back button redirects to a blank modal #93660

Closed

Description

@applause-bot

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.4.8-0
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from BrowserStack: https://test-management.browserstack.com/projects/2219752/folder/13176677/test-cases/41237672
Email or phone of affected tester (no customers): anyname333@tstsg.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: Linux, Chrome
App Component: Other

Action Performed:

  1. Go to https://staging.expensify.com/
  2. Click Manage expenses for 1-9 employees
  3. Sign up using a valid tstsg.com email address: @tstsg.com
  4. Click Get started for free > Join
  5. Enter the First name and click Continue > Skip
  6. Click the back arrow in 'How many employees do you have?' modal

Expected Result:

The back button should not be displayed in the 'How many employees do you have?' modal.

Actual Result:

The back button redirects the user to a blank modal.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7181771_1781564211234.Screencast_From_2026-06-15_19-45-46.mp4

View all open jobs on GitHub

Applause Internal Information
Exported by: Rizky Gunawan
Bug ID: 7181771

Upwork Automation - Do Not Edit
Issue OwnerCurrent Issue Owner: @mallenexpensify

Activity

  1. applause-bot commented on Jun 16, 2026

    @applause-bot
    Author

    While Applause doesn't embed attachments for this bug, here are the links for quick view:
    https://platform.applause.com/services/links/v1/external/eb7ce277d2fa4753590fcf4346cb8317e39266ffc8d65847055ec5c0f21fa51b

  2. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Jun 16, 2026
  3. MelvinBot commented on Jun 16, 2026

    @MelvinBot
    Contributor

    Proposal

    What is the root cause of that problem?

    The back button's visibility and its destination both come from the same onboarding flow array built in getOnboardingFlow.

    For the reproduction account — a VSB signup (the "1-9 employees" landing-page option) on a non-public test domain (tstsg.com) — account.isFromPublicDomain is false and account.hasAccessibleDomainPolicies is true. That combination makes getDomainPrefix return [PERSONAL_DETAILS, PRIVATE_DOMAIN, WORKSPACES], so the VSB flow becomes:

    [PERSONAL_DETAILS, PRIVATE_DOMAIN, WORKSPACES, EMPLOYEES, ACCOUNTING, INTERESTED_FEATURES]

    EMPLOYEES is therefore step 4, so isEmployeesFirstStep is false and the back arrow renders (BaseOnboardingEmployees.tsx:126). Pressing it routes back to the previous flow entry, WORKSPACES (getPreviousOnboardingRoute).

    That WORKSPACES screen renders blank: re-focusing it re-fires getAccessiblePolicies() (BaseOnboardingWorkspaces.tsx:153-159), and for a test domain with no joinable policies the list is empty while loading is true. In that state BaseSelectionList.tsx:617-619 short-circuits to the loading skeleton and hides the customListHeader (the "Join a workspace" title) — i.e. a blank-looking modal.

    The crux: the user is sent to EMPLOYEES from WORKSPACES via Skip (BaseOnboardingWorkspaces.tsx:161-172). Once skipped, WORKSPACES is no longer a meaningful "previous" step — yet it still counts in the flow, so EMPLOYEES gets a dead back button. This is the same class of bug the code already guards against for the public-domain path, where getDomainPrefix returns [] when isMergeAccountStepSkipped === true ("navigating back to it immediately redirects forward again… prevents a dead back button"). The private-domain branch is missing the equivalent guard.

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

    Mirror the existing public-domain guard for the private-domain prefix. When the user has skipped joining a workspace, drop the [PERSONAL_DETAILS, PRIVATE_DOMAIN, WORKSPACES] prefix so EMPLOYEES becomes step 1 and no back button is shown:

    1. Add an onboarding flag (e.g. isJoinWorkspacesSkipped on NVP_ONBOARDING), set via Onyx.merge inside skipJoiningWorkspaces (BaseOnboardingWorkspaces.tsx:161-172) for the VSB/SMB branch.
    2. Thread it through OnboardingFlowContext (getOnboardingStepCounter.ts:10-16), useOnboardingStepCounter, and the BaseOnboardingEmployees context memo.
    3. In getDomainPrefix, return [] when that flag is set:

    if context.hasAccessibleDomainPolicies → if isJoinWorkspacesSkipped return [], else return the existing prefix.

    This applies equally to VSB and SMB, which share the same qualifier suffix.

    What alternative solutions did you explore? (Optional)

    • Fix the blank render only (show the "Join a workspace" header during the loading state in BaseSelectionList). This hides the symptom but leaves a back button that returns the user to a step they intentionally skipped, so it's not a real fix.
    • Suppress the back button on EMPLOYEES whenever it was reached via Skip (e.g. a route param) without touching the step counter — simpler, but the step counter would still show "step 4 of 6", which is also wrong.
    Confidence & verification notes
    • High confidence on the flow/step-counter mechanism (back button shown because EMPLOYEES is step 4, back destination is WORKSPACES) — verified against the cited code.
    • Medium confidence on the precise "blank" rendering: the most likely cause is the loading-skeleton path hiding the header in BaseSelectionList.tsx:617-619 during the second getAccessiblePolicies call. Runtime/VictoriaLogs confirmation that tstsg.com returns isFromPublicDomain=false, hasAccessibleDomainPolicies=true, validated, and empty joinable policies would raise this to high.
    • Navigator/entry routing verified at OnboardingModalNavigator.tsx:47-53 and BaseOnboardingPersonalDetails.tsx:145-148.

    Next Steps for Contributor+ team:
    To accept: @MelvinBot implement [this](https://github.com/Expensify/App/issues/93660) to create a draft PR.
    To refine: @MelvinBot <your feedback>
    To reject: Explain why you are rejecting Melvin's proposal.

  4. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Jun 16, 2026
  5. MobileMage commented on Jun 16, 2026

    @MobileMage
    Contributor

    Proposal

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

    When a VSB-qualified user (signs up via "Manage expenses for 1-9 employees") on a private domain with accessible policies goes through onboarding — First name → Continue → Skip — they land on the "How many employees do you have?" (OnboardingEmployees) screen with a back arrow rendered. Pressing that back arrow navigates to an empty/blank modal instead of a meaningful screen. The expected behavior is that the back button should not appear on this screen for this flow.

    What is the root cause of that problem?

    Both the back-button visibility and its navigation target on OnboardingEmployees are derived from the same source: the flow array produced by getOnboardingFlow in getOnboardingStepCounter.ts. BaseOnboardingEmployees shows the back arrow when the employees screen is not the first step (shouldShowBackButton={!isEmployeesFirstStep}), and isEmployeesFirstStep comes from useOnboardingStepCounter, which uses the index of EMPLOYEES inside that flow array.

    For a VSB user the qualifier suffix is [EMPLOYEES, ACCOUNTING, INTERESTED_FEATURES], so EMPLOYEES is meant to be step 1. But on a private domain (!isFromPublicDomain && hasAccessibleDomainPolicies), getDomainPrefix prepends [PERSONAL_DETAILS, PRIVATE_DOMAIN, WORKSPACES], and getOnboardingFlow returns the concatenation [...prefix, ...qualifierSuffix]:

    const qualifierSuffix = context.signupQualifier ? qualifierSuffixes[context.signupQualifier] : null;
    if (qualifierSuffix) {
    return [...prefix, ...qualifierSuffix];
    }

    So the flow becomes [PERSONAL_DETAILS, PRIVATE_DOMAIN, WORKSPACES, EMPLOYEES, ACCOUNTING, INTERESTED_FEATURES] (this is exactly what the existing test "returns 6-step flow for private domain + VSB" asserts). EMPLOYEES is now index 3 → step 4, so isEmployeesFirstStep is false and the back arrow renders.

    The blank modal comes from where that back arrow points. handleBackButtonPress calls getPreviousOnboardingRoute(EMPLOYEES, ...), which returns flow.at(index - 1) = the WORKSPACES route:

    const handleBackButtonPress = useCallback(() => {
    const previousRoute = getPreviousOnboardingRoute(SCREENS.ONBOARDING.EMPLOYEES, onboardingFlowContext, route.params?.backTo);
    if (previousRoute) {
    Navigation.navigate(previousRoute);
    return;
    }
    Navigation.goBack(ROUTES.ONBOARDING_PURPOSE.getRoute());
    }, [onboardingFlowContext, route.params?.backTo]);

    The problem is that a VSB user never has a meaningful Workspaces step. In the forward flow, a validated user goes PersonalDetails → Workspaces and immediately taps "Skip for now" (skipJoiningWorkspaces → ROUTES.ONBOARDING_EMPLOYEES), and an unvalidated user skips PrivateDomain straight to Employees — in both cases there are no joinable policies for a self-qualified VSB signup. Navigating back lands on BaseOnboardingWorkspaces, whose list data (Object.values(joinablePolicies ?? {})) is empty and whose getAccessiblePolicies() returns nothing, so the modal shows no actionable content — a blank workspaces modal. This is the same "dead back button" class of bug the codebase already identified for the skipped work-email step, where the fix was to exclude the bypassed screen from the navigable flow (see the isMergeAccountStepSkipped === true → return [] branch and its comment in getDomainPrefix).

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

    For the qualifier-driven flows (VSB/SMB), EMPLOYEES is the true entry point of the company-profile sequence — the domain prefix screens (PersonalDetails/PrivateDomain/Workspaces) are pre-qualification setup that the user has already passed and cannot meaningfully return to. We should make the qualifier flow not depend on the domain prefix, so EMPLOYEES is step 1 and the back arrow is hidden — exactly the codebase's existing remedy for bypassed prefix screens. In getOnboardingFlow, return the qualifier suffix without the prefix:

    const qualifierSuffix = context.signupQualifier ? qualifierSuffixes[context.signupQualifier] : null;
    if (qualifierSuffix) {
        // VSB/SMB users enter the company-profile sequence at EMPLOYEES; the domain
        // prefix screens are bypassed setup and are not navigable back targets.
        return qualifierSuffix;
    }

    This is a single, well-scoped change: both the back-button visibility (isEmployeesFirstStep) and the back target (getPreviousOnboardingRoute, whose only caller is BaseOnboardingEmployees) derive from this array, so EMPLOYEES becomes step 1, shouldShowBackButton is false, and there is no dead back navigation. The step counter for VSB/SMB also becomes the intended 1/3 → 2/3 → 3/3 (matching the "without domain context" tests) instead of a 4/6-style count that exposes pre-qualification screens. The individual qualifier path is untouched (it returns null from qualifierSuffixes and continues to the purpose-based branch), so this only affects VSB/SMB. The existing private-domain VSB/SMB tests that assert the prefixed flow (e.g. "returns workspaces for VSB with accessible domain policies") should be updated to reflect that EMPLOYEES is the first step with no previous route.

    What alternative solutions did you explore? (Optional)

    I considered keeping the back button and instead making getPreviousOnboardingRoute resolve to a non-blank screen (e.g. PersonalDetails), but the qualified user has no reason to re-edit those pre-qualification screens and QA's expected result is explicitly "no back button," so changing the flow array is both simpler and matches intent. I also considered fixing BaseOnboardingWorkspaces to redirect when empty, but that only patches the blank symptom while leaving an incorrect back arrow and an off-by-N step counter.

  6. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Jun 16, 2026
  7. David-2002065 commented on Jun 16, 2026

    @David-2002065
    Contributor

    Proposal

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

    For a VSB user (landing page “Manage expenses for 1-9 employees”) signing up on a private domain with accessible policies, the back arrow on the “How many employees do you have?” (OnboardingEmployees) screen is shown and navigates to a blank modal instead of the screen the user actually came from.

    What is the root cause of that problem?

    On a private domain a user only ever traverses one of PRIVATE_DOMAIN / WORKSPACES before EMPLOYEES, gated by validation in BaseOnboardingPersonalDetails:

    if (isPrivateDomainAndHasAccessiblePolicies && (!onboardingPurposeSelected || isVsb || isSmb)) {
    const nextRoute = isValidated ? ROUTES.ONBOARDING_WORKSPACES : ROUTES.ONBOARDING_PRIVATE_DOMAIN;
    Navigation.navigate(nextRoute.getRoute(route.params?.backTo));
    return;

    • Unvalidated (the repro): PERSONAL_DETAILS → PRIVATE_DOMAIN, and Skip on that screen jumps straight to EMPLOYEES, never reaching WORKSPACES:
      const navigateToNextOnboardingStep = useCallback(
      (backTo: string | undefined, options?: {forceReplace?: boolean}) => {
      if (isVsb || isSmb) {
      Navigation.navigate(ROUTES.ONBOARDING_EMPLOYEES.getRoute(backTo), options);
      return;
      }
      Navigation.navigate(ROUTES.ONBOARDING_PURPOSE.getRoute(backTo), options);
      },
      [isVsb, isSmb],
      );
    • Validated: PERSONAL_DETAILS → WORKSPACES, skipping PRIVATE_DOMAIN.

    But the flow model hardcodes both screens for every private-domain user in getDomainPrefix:

    if (context.hasAccessibleDomainPolicies) {
    return [ONBOARDING.PERSONAL_DETAILS, ONBOARDING.PRIVATE_DOMAIN, ONBOARDING.WORKSPACES];

    So getOnboardingFlow builds [PERSONAL_DETAILS, PRIVATE_DOMAIN, WORKSPACES, EMPLOYEES, …] — inserting a phantom step the user never visited:

    function getOnboardingFlow(context: OnboardingFlowContext): OnboardingScreen[] | undefined {
    const prefix = getDomainPrefix(context);
    const isPrivateDomain = !context.isFromPublicDomain && !!context.hasAccessibleDomainPolicies;
    const qualifierSuffix = context.signupQualifier ? qualifierSuffixes[context.signupQualifier] : null;
    if (qualifierSuffix) {
    return [...prefix, ...qualifierSuffix];
    }
    if (!context.purposeSelected) {
    return undefined;
    }
    const suffix = purposeSuffixes[context.purposeSelected];
    const adjustedSuffix = isPrivateDomain ? suffix.filter((s) => s !== ONBOARDING.PERSONAL_DETAILS) : suffix;
    return [...prefix, ONBOARDING.PURPOSE, ...adjustedSuffix];
    }

    Two consequences on EMPLOYEES:

    1. It is computed as step 4, so isEmployeesFirstStep is false and the back arrow renders (L35 / L126).
    2. getPreviousOnboardingRoute returns the element before EMPLOYEES — WORKSPACES — which an unvalidated user never reached and which renders an empty (blank) list:
      function getPreviousOnboardingRoute(page: OnboardingScreen, context: OnboardingFlowContext, backTo?: string): Route | undefined {
      const flow = getOnboardingFlow(context);
      if (!flow) {
      return undefined;
      }
      const resolvedPage = getResolvedPage(page, context);
      const index = flow.indexOf(resolvedPage);
      if (index <= 0) {
      return undefined;
      }
      const previousScreen = flow.at(index - 1);
      if (!previousScreen) {
      return undefined;
      }
      return getOnboardingRouteFromScreen(previousScreen, backTo);
      }

    This is the same “skipped screen left in the prefix → dead/blank back button” class the code already guards against for the public-domain path:

    // The user skipped the work email step, so it is no longer a reachable part of the flow: navigating back to it
    // immediately redirects forward again. Excluding it keeps the step counter accurate and prevents a dead back button.
    if (context.isMergeAccountStepSkipped === true) {
    return [];
    }

    Note this is not covered by #93399 — that PR adds an isAccountValidated guard only to the isFromPublicDomain branch (confirmed by the author here); the hasAccessibleDomainPolicies branch still hardcodes both screens.

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

    Make the private-domain prefix reflect the screen the user actually reaches, keyed off validation — the exact signal BaseOnboardingPersonalDetails already branches on. In the hasAccessibleDomainPolicies case of getDomainPrefix:

    if (context.hasAccessibleDomainPolicies) {
      // Validated users go PERSONAL_DETAILS → WORKSPACES; unvalidated users go PERSONAL_DETAILS → PRIVATE_DOMAIN
      // and skip straight to EMPLOYEES. Only the screen actually traversed belongs in the flow, otherwise the
      // EMPLOYEES back button resolves to a screen that was never visited and renders blank.
      return context.isAccountValidated
        ? [ONBOARDING.PERSONAL_DETAILS, ONBOARDING.WORKSPACES]
        : [ONBOARDING.PERSONAL_DETAILS, ONBOARDING.PRIVATE_DOMAIN];
    }

    This mirrors exactly what #93399 already does for the public-domain branch, and reuses the infrastructure that PR landed: isAccountValidated is already added to OnboardingFlowContext and threaded through useOnboardingStepCounter and the BaseOnboardingEmployees context memo — so this is a self-contained ~4-line change with no new plumbing. (If this lands first, we add the isAccountValidated?: boolean field and feed !!account?.validated into both context builders, identically to #93399.)

    Result for the repro (unvalidated/private/VSB): flow becomes [PERSONAL_DETAILS, PRIVATE_DOMAIN, EMPLOYEES, …]. The back arrow now resolves to PRIVATE_DOMAIN — the screen the user came from, which renders normally for an unvalidated user (the redirect effects only fire once validated, L99-L119) — instead of the blank WORKSPACES, and the step counter becomes accurate. The validated path resolves Back to WORKSPACES, which that user did visit. Public-domain and no-domain flows are untouched (different branches).

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

    In tests/unit/getOnboardingStepCounterTest.ts, update the private-domain VSB/SMB cases so the flow is [PERSONAL_DETAILS, PRIVATE_DOMAIN, EMPLOYEES, …] when isAccountValidated is false and [PERSONAL_DETAILS, WORKSPACES, EMPLOYEES, …] when true, and assert getPreviousOnboardingRoute(EMPLOYEES, …) returns PRIVATE_DOMAIN (unvalidated) / WORKSPACES (validated) — never the skipped screen. A UI test mirroring the work-email fix: an unvalidated private-domain VSB user pressing Back on EMPLOYEES lands on PRIVATE_DOMAIN, not a blank WORKSPACES.

    What alternative solutions did you explore? (Optional)

    • Hide the back button on EMPLOYEES (force isEmployeesFirstStep) — matches the reporter’s literal expectation, but the user genuinely traversed PERSONAL_DETAILS and PRIVATE_DOMAIN, so a working back button to the real previous screen is better UX and keeps the step counter honest, consistent with how fix: App back button loops between employee step and verify email step #93399 handles the count.
    • Gate WORKSPACES on the joinable-policies count instead of validation — also correct and keeps the total exact in the rarer validate-then-workspaces path, but requires plumbing the JOINABLE_POLICIES collection into the step counter when validation is the same signal BaseOnboardingPersonalDetails already uses to branch.
    • Navigation.goBack() in BaseOnboardingEmployees — fixes only the blank destination while leaving the inflated step counter and the phantom WORKSPACES wrong for every other reader of the flow array.
  8. ahmdshrif commented on Jun 16, 2026

    @ahmdshrif
    Contributor

    Proposal

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

    During onboarding, pressing the Back button can land the user on a blank modal instead of the previous onboarding step. The back navigation targets a screen that is not actually present in the user's current onboarding flow.

    What is the root cause of that problem?

    Onboarding back buttons are inconsistent. The flow is computed dynamically per user (purpose, signup qualifier, public/private domain) in getOnboardingFlow, and OnboardingEmployees correctly derives its back target from that flow via getPreviousOnboardingRoute:

    • function getPreviousOnboardingRoute(page: OnboardingScreen, context: OnboardingFlowContext, backTo?: string): Route | undefined {
      const flow = getOnboardingFlow(context);
      if (!flow) {
      return undefined;
      }
      const resolvedPage = getResolvedPage(page, context);
      const index = flow.indexOf(resolvedPage);
      if (index <= 0) {
      return undefined;
      }
      const previousScreen = flow.at(index - 1);
      if (!previousScreen) {
      return undefined;
      }
      return getOnboardingRouteFromScreen(previousScreen, backTo);
      }
    • const handleBackButtonPress = useCallback(() => {
      const previousRoute = getPreviousOnboardingRoute(SCREENS.ONBOARDING.EMPLOYEES, onboardingFlowContext, route.params?.backTo);
      if (previousRoute) {
      Navigation.navigate(previousRoute);
      return;
      }
      Navigation.goBack(ROUTES.ONBOARDING_PURPOSE.getRoute());
      }, [onboardingFlowContext, route.params?.backTo]);

    But OnboardingAccounting hardcodes its back target to ONBOARDING_EMPLOYEES:

    For users whose flow does not contain the Employees step (e.g. flows whose purposeSuffixes/qualifierSuffixes skip it), Navigation.goBack(ROUTES.ONBOARDING_EMPLOYEES.getRoute()) falls back to navigating to a screen that is not mounted in the stack, which renders as an empty/blank modal.

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

    Make the Accounting back button derive its target from the dynamic flow, exactly like Employees does, instead of hardcoding ONBOARDING_EMPLOYEES:

    const handleBackButtonPress = useCallback(() => {
        const previousRoute = getPreviousOnboardingRoute(SCREENS.ONBOARDING.ACCOUNTING, onboardingFlowContext, route.params?.backTo);
        Navigation.goBack(previousRoute ?? ROUTES.ONBOARDING_EMPLOYEES.getRoute());
    }, [onboardingFlowContext, route.params?.backTo]);

    and wire onBackButtonPress={handleBackButtonPress} (BaseOnboardingAccounting.tsx#L232). The same getPreviousOnboardingRoute-based pattern should be audited across the other hardcoded onboarding back buttons. Regression check: confirm Back still reaches the correct prior step for each purpose/qualifier/domain flow and never lands on a blank modal.

  9. melvin-bot commented on Jun 16, 2026

    @melvin-bot

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

  10. mkzie2 commented on Jun 16, 2026

    @mkzie2
    Contributor

    Proposal

    What is the root cause of that problem?

    getOnboardingFlow always inserts WORKSPACES into the private-domain prefix:

    function getDomainPrefix(context: OnboardingFlowContext): OnboardingScreen[] {
    if (context.isFromPublicDomain) {
    if (context.isMergeAccountStepSkipped === false) {
    return [ONBOARDING.WORK_EMAIL, ONBOARDING.WORK_EMAIL_VALIDATION, ONBOARDING.WORKSPACES];
    }
    // The user skipped the work email step, so it is no longer a reachable part of the flow: navigating back to it
    // immediately redirects forward again. Excluding it keeps the step counter accurate and prevents a dead back button.
    if (context.isMergeAccountStepSkipped === true) {
    return [];
    }
    return [ONBOARDING.WORK_EMAIL, ONBOARDING.WORK_EMAIL_VALIDATION];
    }
    if (context.hasAccessibleDomainPolicies) {
    return [ONBOARDING.PERSONAL_DETAILS, ONBOARDING.PRIVATE_DOMAIN, ONBOARDING.WORKSPACES];
    }
    return [];
    }

    But for a VSB/SMB user on a private domain, the WORKSPACES ("Join a workspace") screen is only ever reached from PRIVATE_DOMAIN when the account is validated and there are joinable policies. When the user taps Skip on the "People you may know" (PRIVATE_DOMAIN) screen they are sent straight to EMPLOYEES, never visiting WORKSPACES:

    const navigateToNextOnboardingStep = useCallback(
    (backTo: string | undefined, options?: {forceReplace?: boolean}) => {
    if (isVsb || isSmb) {
    Navigation.navigate(ROUTES.ONBOARDING_EMPLOYEES.getRoute(backTo), options);
    return;
    }
    Navigation.navigate(ROUTES.ONBOARDING_PURPOSE.getRoute(backTo), options);
    },
    [isVsb, isSmb],
    );

    Because the static flow still lists WORKSPACES immediately before EMPLOYEES, two things break on the Employees screen:

    • the step counter reports EMPLOYEES as step 4, so isEmployeesFirstStep is false and the back button is rendered, and
    • handleBackButtonPress calls getPreviousOnboardingRoute(EMPLOYEES, …), which returns WORKSPACES, and Navigation.navigate opens it fresh.

    const handleBackButtonPress = useCallback(() => {
    const previousRoute = getPreviousOnboardingRoute(SCREENS.ONBOARDING.EMPLOYEES, onboardingFlowContext, route.params?.backTo);
    if (previousRoute) {
    Navigation.navigate(previousRoute);
    return;
    }
    Navigation.goBack(ROUTES.ONBOARDING_PURPOSE.getRoute());
    }, [onboardingFlowContext, route.params?.backTo]);

    WORKSPACES opened this way has no joinable policies loaded — the user is unvalidated, so its useFocusEffect never fetches them — and renders an empty list, which is the "blank modal" in the report.

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

    Make the Employees back button follow the real navigation history instead of recomputing a previous route that may never have been visited. The back button is only shown when EMPLOYEES is not the first step, which means a real preceding onboarding screen is always on the stack, so Navigation.goBack() is safe and lands on the screen the user actually came from (PRIVATE_DOMAIN) — exactly as BaseOnboardingWorkspaces and the private-domain branch of BaseOnboardingPersonalDetails already do.

    In BaseOnboardingEmployees:

    const handleBackButtonPress = useCallback(() => {
    const previousRoute = getPreviousOnboardingRoute(SCREENS.ONBOARDING.EMPLOYEES, onboardingFlowContext, route.params?.backTo);
    if (previousRoute) {
    Navigation.navigate(previousRoute);
    return;
    }
    Navigation.goBack(ROUTES.ONBOARDING_PURPOSE.getRoute());
    }, [onboardingFlowContext, route.params?.backTo]);

    const handleBackButtonPress = useCallback(() => {
        Navigation.goBack();
    }, []);

    The getPreviousOnboardingRoute import and the onboardingFlowContext memo (used only for that call) can then be removed.

    This eliminates the blank modal in every path: the skip-from-private-domain path returns to PRIVATE_DOMAIN, the validated + joinable-policies path still returns to WORKSPACES (which the user did visit), and the public-domain VSB skip path keeps the back button hidden (step 1) as today.

    What alternative solutions did you explore? (Optional)

    • Literally hiding the back button on EMPLOYEES for VSB/SMB (the reporter's stated expectation). This is worse: the user genuinely traversed PERSONAL_DETAILS and PRIVATE_DOMAIN, so removing back navigation throws away legitimate history; goBack() keeps a working back button while fixing the dead destination.
    • Threading joinable-policy reachability into getOnboardingFlow so WORKSPACES is excluded from the prefix when it isn't reachable (mirroring how WORK_EMAIL is excluded once skipped). This corrects the inflated step counter too, but is a larger change to the flow model; it can be added on top of the goBack() fix if an exact step count is desired, but is not required to fix the blank modal.
  11. changed the title [-]Onboarding - Back button redirects to a blank modal[/-] [+][$250] Onboarding - Back button redirects to a blank modal[/+] on Jun 16, 2026
  12. melvin-bot commented on Jun 16, 2026

    @melvin-bot
  13. 78 remaining items

  14. melvin-bot commented on Jul 15, 2026

    @melvin-bot

    @jayeshmangwani Huh... This is 4 days overdue. Who can take care of this?

  15. melvin-bot commented on Jul 16, 2026

    @melvin-bot

    Triggered auto assignment to @mallenexpensify (Awaiting Payment)

  16. melvin-bot commented on Jul 16, 2026

    @melvin-bot

    Payment Summary

    Upwork Job

    • Reviewer: @jayeshmangwani owed $250 via NewDot
    • ROLE: @dilshodmackbook-sketch paid $(AMOUNT) via Upwork (LINK)

    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/2066769441646975179/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
  17. jayeshmangwani commented on Jul 17, 2026

    @jayeshmangwani
    Contributor

    BugZero Checklist:

    Regression Test Proposal

    Test:

    1. Go to https://expensify.com/ (OD).
    2. Click Manage expenses for 1–9 employees.
    3. Sign up using a valid @tstsg.com email address (or any private domain email that does not have any workspaces created under that domain).
    4. Click Get started for free > Join.
    5. Enter your first name and click Continue.
    6. On the Enter your magic code modal (onboarding/private-domain), click Skip.
    7. On the How many employees do you have? modal, tap the back arrow.
    8. Verify that, The back button navigates to the previous Enter your magic code (onboarding/private-domain) screen, where you can enter the verification code.

    Do we agree 👍 or 👎

    Zapier Logs Run ID: 00040eee-97fa-a9d3-89bf-f803a5d240f4
  18. mallenexpensify commented on Jul 21, 2026

    @mallenexpensify
    Contributor

    Payment Summary

    Contributor: @dilshodmackbook-sketch paid $250 via Upwork
    Contributor+: @jayeshmangwani due $250 via NewDot

    @dilshodmackbook-sketch can you please accept the job below? Please reply here and tag me once you have.
    https://www.upwork.com/jobs/~022079363822113702532

    ^ Test case created. Thx

  19. David-2002065 commented on Jul 21, 2026

    @David-2002065
    Contributor

    Payment Summary

    Contributor: @dilshodmackbook-sketch due $250 via Upwork Contributor+: @jayeshmangwani due $250 via NewDot

    @dilshodmackbook-sketch can you please accept the job below? Please reply here and tag me once you have. https://www.upwork.com/jobs/~022079363822113702532

    ^ Test case created. Thx

    accepted thanks

  20. mallenexpensify commented on Jul 22, 2026

    @mallenexpensify
    Contributor

    @dilshodmackbook-sketch paid, summary updated above. Thx.

  21. quinthar commented on Jul 31, 2026

    @quinthar
    Contributor

    Approved $250 to @jayeshmangwani

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.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions