You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Due for payment 2026-07-17] [$250] Onboarding - Back button redirects to a blank modal #93660
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
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
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:
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:
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.
Thread it through OnboardingFlowContext (getOnboardingStepCounter.ts:10-16), useOnboardingStepCounter, and the BaseOnboardingEmployees context memo.
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.
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.
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]:
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:
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:
constqualifierSuffix=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.returnqualifierSuffix;}
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.
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:
It is computed as step 4, so isEmployeesFirstStep is false and the back arrow renders (L35 / L126).
getPreviousOnboardingRoute returns the element before EMPLOYEES — WORKSPACES — which an unvalidated user never reached and which renders an empty (blank) list:
// 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.returncontext.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.
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:
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:
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.
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:
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.
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.
changed the title [-]Onboarding - Back button redirects to a blank modal[/-][+][$250] Onboarding - Back button redirects to a blank modal[/+]on Jun 16, 2026
[Contributor] The offending PR and associated issue have been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
[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: Not that CRITICAL
[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.
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Sign up using a valid @tstsg.com email address (or any private domain email that does not have any workspaces created under that domain).
Click Get started for free > Join.
Enter your first name and click Continue.
On the Enter your magic code modal (onboarding/private-domain), click Skip.
On the How many employees do you have? modal, tap the back arrow.
Verify that, The back button navigates to the previous Enter your magic code (onboarding/private-domain) screen, where you can enter the verification code.
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
Activity
applause-bot commentedon Jun 16, 2026
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
MelvinBot commentedon Jun 16, 2026
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.isFromPublicDomainisfalseandaccount.hasAccessibleDomainPoliciesistrue. That combination makesgetDomainPrefixreturn[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
isEmployeesFirstStepisfalseand 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 whileloadingistrue. In that stateBaseSelectionList.tsx:617-619short-circuits to the loading skeleton and hides thecustomListHeader(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, wheregetDomainPrefixreturns[]whenisMergeAccountStepSkipped === 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:isJoinWorkspacesSkippedonNVP_ONBOARDING), set viaOnyx.mergeinsideskipJoiningWorkspaces(BaseOnboardingWorkspaces.tsx:161-172) for the VSB/SMB branch.OnboardingFlowContext(getOnboardingStepCounter.ts:10-16),useOnboardingStepCounter, and theBaseOnboardingEmployeescontext memo.getDomainPrefix, return[]when that flag is set:This applies equally to VSB and SMB, which share the same qualifier suffix.
What alternative solutions did you explore? (Optional)
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.Confidence & verification notes
BaseSelectionList.tsx:617-619during the secondgetAccessiblePoliciescall. Runtime/VictoriaLogs confirmation thattstsg.comreturnsisFromPublicDomain=false,hasAccessibleDomainPolicies=true, validated, and empty joinable policies would raise this to high.OnboardingModalNavigator.tsx:47-53andBaseOnboardingPersonalDetails.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.
MobileMage commentedon Jun 16, 2026
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
getOnboardingFlowingetOnboardingStepCounter.ts.BaseOnboardingEmployeesshows the back arrow when the employees screen is not the first step (shouldShowBackButton={!isEmployeesFirstStep}), andisEmployeesFirstStepcomes fromuseOnboardingStepCounter, 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),getDomainPrefixprepends[PERSONAL_DETAILS, PRIVATE_DOMAIN, WORKSPACES], andgetOnboardingFlowreturns the concatenation[...prefix, ...qualifierSuffix]:App/src/libs/getOnboardingStepCounter.ts
Lines 95 to 98 in 7af4b0e
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, soisEmployeesFirstStepisfalseand the back arrow renders.The blank modal comes from where that back arrow points.
handleBackButtonPresscallsgetPreviousOnboardingRoute(EMPLOYEES, ...), which returnsflow.at(index - 1)= the WORKSPACES route:App/src/pages/OnboardingEmployees/BaseOnboardingEmployees.tsx
Lines 54 to 63 in 7af4b0e
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 onBaseOnboardingWorkspaces, whose list data (Object.values(joinablePolicies ?? {})) is empty and whosegetAccessiblePolicies()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 theisMergeAccountStepSkipped === true → return []branch and its comment ingetDomainPrefix).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:This is a single, well-scoped change: both the back-button visibility (
isEmployeesFirstStep) and the back target (getPreviousOnboardingRoute, whose only caller isBaseOnboardingEmployees) derive from this array, so EMPLOYEES becomes step 1,shouldShowBackButtonisfalse, and there is no dead back navigation. The step counter for VSB/SMB also becomes the intended1/3 → 2/3 → 3/3(matching the "without domain context" tests) instead of a 4/6-style count that exposes pre-qualification screens. Theindividualqualifier path is untouched (it returnsnullfromqualifierSuffixesand 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
getPreviousOnboardingRouteresolve 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 fixingBaseOnboardingWorkspacesto redirect when empty, but that only patches the blank symptom while leaving an incorrect back arrow and an off-by-N step counter.David-2002065 commentedon Jun 16, 2026
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/WORKSPACESbeforeEMPLOYEES, gated by validation inBaseOnboardingPersonalDetails:App/src/pages/OnboardingPersonalDetails/BaseOnboardingPersonalDetails.tsx
Lines 145 to 148 in 2b78b56
PERSONAL_DETAILS → PRIVATE_DOMAIN, and Skip on that screen jumps straight toEMPLOYEES, never reachingWORKSPACES:App/src/pages/OnboardingPrivateDomain/BaseOnboardingPrivateDomain.tsx
Lines 74 to 83 in 2b78b56
PERSONAL_DETAILS → WORKSPACES, skippingPRIVATE_DOMAIN.But the flow model hardcodes both screens for every private-domain user in
getDomainPrefix:App/src/libs/getOnboardingStepCounter.ts
Lines 85 to 86 in 2b78b56
So
getOnboardingFlowbuilds[PERSONAL_DETAILS, PRIVATE_DOMAIN, WORKSPACES, EMPLOYEES, …]— inserting a phantom step the user never visited:App/src/libs/getOnboardingStepCounter.ts
Lines 91 to 107 in 2b78b56
Two consequences on
EMPLOYEES:isEmployeesFirstStepisfalseand the back arrow renders (L35 / L126).getPreviousOnboardingRoutereturns the element beforeEMPLOYEES—WORKSPACES— which an unvalidated user never reached and which renders an empty (blank) list:App/src/libs/getOnboardingStepCounter.ts
Lines 138 to 156 in 2b78b56
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:
App/src/libs/getOnboardingStepCounter.ts
Lines 78 to 82 in 2b78b56
Note this is not covered by #93399 — that PR adds an
isAccountValidatedguard only to theisFromPublicDomainbranch (confirmed by the author here); thehasAccessibleDomainPoliciesbranch 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
BaseOnboardingPersonalDetailsalready branches on. In thehasAccessibleDomainPoliciescase ofgetDomainPrefix:This mirrors exactly what #93399 already does for the public-domain branch, and reuses the infrastructure that PR landed:
isAccountValidatedis already added toOnboardingFlowContextand threaded throughuseOnboardingStepCounterand theBaseOnboardingEmployeescontext memo — so this is a self-contained ~4-line change with no new plumbing. (If this lands first, we add theisAccountValidated?: booleanfield and feed!!account?.validatedinto 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 toPRIVATE_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 blankWORKSPACES, and the step counter becomes accurate. The validated path resolves Back toWORKSPACES, 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, …]whenisAccountValidatedis false and[PERSONAL_DETAILS, WORKSPACES, EMPLOYEES, …]when true, and assertgetPreviousOnboardingRoute(EMPLOYEES, …)returnsPRIVATE_DOMAIN(unvalidated) /WORKSPACES(validated) — never the skipped screen. A UI test mirroring the work-email fix: an unvalidated private-domain VSB user pressing Back onEMPLOYEESlands onPRIVATE_DOMAIN, not a blankWORKSPACES.What alternative solutions did you explore? (Optional)
EMPLOYEES(forceisEmployeesFirstStep) — matches the reporter’s literal expectation, but the user genuinely traversedPERSONAL_DETAILSandPRIVATE_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.WORKSPACESon the joinable-policies count instead of validation — also correct and keeps the total exact in the rarer validate-then-workspaces path, but requires plumbing theJOINABLE_POLICIEScollection into the step counter when validation is the same signalBaseOnboardingPersonalDetailsalready uses to branch.Navigation.goBack()inBaseOnboardingEmployees— fixes only the blank destination while leaving the inflated step counter and the phantomWORKSPACESwrong for every other reader of the flow array.ahmdshrif commentedon Jun 16, 2026
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, andOnboardingEmployeescorrectly derives its back target from that flow viagetPreviousOnboardingRoute:App/src/libs/getOnboardingStepCounter.ts
Lines 138 to 156 in 7af4b0e
App/src/pages/OnboardingEmployees/BaseOnboardingEmployees.tsx
Lines 54 to 63 in 7af4b0e
But
OnboardingAccountinghardcodes its back target toONBOARDING_EMPLOYEES:App/src/pages/OnboardingAccounting/BaseOnboardingAccounting.tsx
Line 232 in 7af4b0e
For users whose flow does not contain the Employees step (e.g. flows whose
purposeSuffixes/qualifierSuffixesskip 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:and wire
onBackButtonPress={handleBackButtonPress}(BaseOnboardingAccounting.tsx#L232). The samegetPreviousOnboardingRoute-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.melvin-bot commentedon Jun 16, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @jayeshmangwani (
External)mkzie2 commentedon Jun 16, 2026
Proposal
What is the root cause of that problem?
getOnboardingFlowalways insertsWORKSPACESinto the private-domain prefix:App/src/libs/getOnboardingStepCounter.ts
Lines 73 to 89 in 7af4b0e
But for a VSB/SMB user on a private domain, the
WORKSPACES("Join a workspace") screen is only ever reached fromPRIVATE_DOMAINwhen 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 toEMPLOYEES, never visitingWORKSPACES:App/src/pages/OnboardingPrivateDomain/BaseOnboardingPrivateDomain.tsx
Lines 74 to 83 in 7af4b0e
Because the static flow still lists
WORKSPACESimmediately beforeEMPLOYEES, two things break on the Employees screen:EMPLOYEESas step 4, soisEmployeesFirstStepisfalseand the back button is rendered, andhandleBackButtonPresscallsgetPreviousOnboardingRoute(EMPLOYEES, …), which returnsWORKSPACES, andNavigation.navigateopens it fresh.App/src/pages/OnboardingEmployees/BaseOnboardingEmployees.tsx
Lines 54 to 63 in 7af4b0e
WORKSPACESopened this way has no joinable policies loaded — the user is unvalidated, so itsuseFocusEffectnever 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
EMPLOYEESis not the first step, which means a real preceding onboarding screen is always on the stack, soNavigation.goBack()is safe and lands on the screen the user actually came from (PRIVATE_DOMAIN) — exactly asBaseOnboardingWorkspacesand the private-domain branch ofBaseOnboardingPersonalDetailsalready do.In
BaseOnboardingEmployees:App/src/pages/OnboardingEmployees/BaseOnboardingEmployees.tsx
Lines 54 to 63 in 7af4b0e
The
getPreviousOnboardingRouteimport and theonboardingFlowContextmemo (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 toWORKSPACES(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)
EMPLOYEESfor VSB/SMB (the reporter's stated expectation). This is worse: the user genuinely traversedPERSONAL_DETAILSandPRIVATE_DOMAIN, so removing back navigation throws away legitimate history;goBack()keeps a working back button while fixing the dead destination.getOnboardingFlowsoWORKSPACESis excluded from the prefix when it isn't reachable (mirroring howWORK_EMAILis 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 thegoBack()fix if an exact step count is desired, but is not required to fix the blank modal.[-]Onboarding - Back button redirects to a blank modal[/-][+][$250] Onboarding - Back button redirects to a blank modal[/+]melvin-bot commentedon Jun 16, 2026
Job added to Upwork: https://www.upwork.com/jobs/~022066769441646975179
78 remaining items
melvin-bot commentedon Jul 15, 2026
@jayeshmangwani Huh... This is 4 days overdue. Who can take care of this?
melvin-bot commentedon Jul 16, 2026
Triggered auto assignment to @mallenexpensify (
Awaiting Payment)melvin-bot commentedon Jul 16, 2026
Payment Summary
Upwork Job
BugZero Checklist (@mallenexpensify)
jayeshmangwani commentedon Jul 17, 2026
BugZero Checklist:
[Contributor] The offending PR and associated issue have been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
Link to the comment on the PR: Show employee size sub-selection (1-4, 5-10) for VSB qualifier users #91748
Link to the comment on the Issue: Show employee size sub-selection (1-4, 5-10) for VSB qualifier users #91748
[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: Not that CRITICAL
[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.
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Link to issue: https://github.com/Expensify/Expensify/issues/662081
Regression Test Proposal
Test:
@tstsg.comemail address (or any private domain email that does not have any workspaces created under that domain).onboarding/private-domain), click Skip.onboarding/private-domain) screen, where you can enter the verification code.Do we agree 👍 or 👎
Zapier Logs
Run ID: 00040eee-97fa-a9d3-89bf-f803a5d240f4mallenexpensify commentedon Jul 21, 2026
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
David-2002065 commentedon Jul 21, 2026
accepted thanks
mallenexpensify commentedon Jul 22, 2026
@dilshodmackbook-sketch paid, summary updated above. Thx.
quinthar commentedon Jul 31, 2026
Approved $250 to @jayeshmangwani