Repository navigation
Description
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.19-1
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/test-runs/TR-48574/folder/13176726/41237087/1515171555?sort=%2Bidentifier
Email or phone of affected tester (no customers): leungbratt6+25064@gmail.com
Issue reported by: Applause Internal Team
Bug source: Regression TC Execution
Device used: Windows 10/Chrome
App Component: Left Hand Navigation (LHN)
Action Performed:
Setup - Can be executed in a Secondary device or browser
- Log in as an admin of a workspace or create one
- Enter a custom name for the workspace
- Navigate to Account Settings > Workspaces > Your new workspace
- In the workspace Settings, click on Members
- Click on the Invite Member button
- Add an email address that does not have an Expensify account
- Click Invite (Should be a real account with an inbox that can receive the invite)
Steps - Main testing device
8. Open the email inbox of the invited user
9. Verify that the new user received an invitation
10. Copy the link at the bottom of the email and change it to staging
11. Verify you do not need to use a magic link
12. Verify that you are redirected to the workspace chat
Expected Result:
Verify that you are redirected to the workspace chat
Actual Result:
Member lands on the Home page
Workaround:
Unknown
Platforms:
- Android: App
- Android: mWeb Chrome
- iOS: App
- iOS: mWeb Safari
- iOS: mWeb Chrome
- Windows: Chrome
- MacOS: Chrome Safari
Screenshots/Videos
Bug7190514_1782358334286.email_member.1.mp4
Applause Internal Information
Exported by: Julia Ponikarchuk
Bug ID: 7190514
Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~022070041782240135206
- Upwork Job ID: 2070041782240135206
- Last Price Increase: 2026-07-02
Issue Owner
Current Issue Owner: @mallenexpensifyMetadata
Metadata
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
applause-bot commentedon Jun 25, 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/7e7eb55d4753ff53d67671a1f66b04f63de04d33386005dcb684177654db21a5
MelvinBot commentedon Jun 25, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
A brand-new user who is invited to a workspace by email, then clicks the invite link (which signs them in without a magic link), lands on the Home page instead of being redirected to the workspace chat.
What is the root cause of that problem?
The invite email link is an OldDot→NewDot transition link carrying an
exitToquery param (the report route to land on). For a logged-out, never-before-seen invitee, the link is handled by the public screenLogInWithShortLivedAuthTokenPage, which signs the user in but does not navigate toexitToitself — it intentionally delegates that tosetUpPoliciesAndNavigate, which runs once whenAuthScreensmounts after sign-in.setUpPoliciesAndNavigateonly performs the redirect when both of these hold:exitTo— otherwise it returns early atApp.ts:838, andApp.ts:873.For the new-invitee flow, the redirect can be skipped because the transition URL/
exitTono longer survives to the single post‑sign‑in pass ofsetUpPoliciesAndNavigate(the function is designed to run again for new users per its own doc comment atApp.ts:819-821, but by thengetCurrentUrl()no longer includesexitTo, so it bails). With the redirect skipped, the authenticated user is left on the default landing — Home. Because the symptom is Home (not a "not found"/loading report page), the failure is the redirect never firing, not the target report being fetched too late.Investigation details & evidence
setUpPoliciesAndNavigate— App.ts:826-878, invoked on mount fromAuthScreensInitHandler.tsx:134.LogInWithShortLivedAuthTokenPage.tsx.emailparam tosession.email:SessionUtils.isLoggingInAsNewUser — SessionUtils.ts:11-41. The authed-screen counterpart redirects new users toROUTES.HOMEatLogOutPreviousUserPage.tsx:74-82.ReportNotFoundGuard, not Home. (b)isLoggingInAsNewUser === trueskipping the redirect atApp.ts:873→ less likely as the sole cause, since once the invitee is signed insession.emailmatches the URLemailparam and the check returnsfalse; the URL-no-longer-contains-exitToearly return atApp.ts:838is the more consistent explanation for the new-user-only repro.Open question (needs confirmation before implementing): the
exitTovalue itself is generated by the backend (OldDot/Web-Expensify) when the invite email is built. This analysis assumes that value correctly points at the workspace chat report. If the email link does not carry anexitTofor the workspace chat for never-validated accounts, the fix is backend-side and outside this repo — a separate internal investigation would be needed. To disambiguate, confirm via a repro what URL the staging invite email produces and whethersetUpPoliciesAndNavigateseesexitToon its post-sign-in pass.What changes do you think we should make in order to solve the problem?
Make the
exitTofrom the transition link survive the new-user sign-in so the post-sign-in pass ofsetUpPoliciesAndNavigatecan still act on it. Concretely: when the public transition page (LogInWithShortLivedAuthTokenPage) signs in a new user, persist theexitToroute (e.g. in Onyx/session) and havesetUpPoliciesAndNavigatefall back to that stored value whengetCurrentUrl()has already lost theexitToparam, then clear it after navigating. This keeps the redirect working for first-time invitees without changing behavior for existing users.This should be confirmed against a real staging repro (and/or logs) first, since the exact failing condition and the backend-supplied
exitTovalue need to be verified before locking in the implementation.Possibly related (not duplicates)
Next Steps for Contributor+ team:
To accept:
@MelvinBot implement [this](https://github.com/Expensify/App/issues/94549)to create a draft PR.To refine:
@MelvinBot <your feedback>To reject: Explain why you are rejecting Melvin's proposal.
aswin-s commentedon Jun 25, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
When a new user (with no existing Expensify account) clicks a workspace invite link from their email and completes the onboarding flow on web (large screen), they are redirected to the Home page instead of the workspace chat. The expected behavior is that they land on the workspace chat after completing onboarding.
What is the root cause of that problem?
In
src/libs/navigateAfterOnboarding.ts,getReportIDAfterOnboarding(lines 41–45) has an early-return for large screens: it returnsonboardingAdminsChatReportIDif set, or immediately returnsundefinedotherwise. For a workspace-invited new member,onboardingAdminsChatReportIDisundefined(they are not an admin), so the function returnsundefined.navigateAfterOnboardingthen falls through toNavigation.navigate(ROUTES.HOME)at line 100. ThefindLastAccessedReportbranch that would have caught the workspace chat report is only reached on small screens — it is completely skipped for large screens, leaving invited members stranded on Home.What changes do you think we should make in order to solve the problem?
src/libs/navigateAfterOnboarding.tslines 41–46: Remove the earlyreturn undefinedon large screens whenonboardingAdminsChatReportIDis not set. Instead fall through to thefindLastAccessedReportlogic so that the workspace chat (the last accessed report the invited user was added to) is returned for large screens too.src/libs/navigateAfterOnboarding.tslines 48–55: Update thefindLastAccessedReportguard condition (lastAccessedReport.policyID !== onboardingPolicyID) to also allow reports matching the inviting policy — currently it excludes the onboarding policy's reports, which may filter out the workspace chat that the invited member should land on. Pass the invitingpolicyID(distinct from any self-createdonboardingPolicyID) or adjust the filter so it does not exclude the target workspace.navigateAfterOnboarding/navigateAfterOnboardingWithMicrotaskQueueinBaseOnboardingPersonalDetails,BaseOnboardingPurpose, andBaseOnboardingInterestedFeaturespass the correctonboardingPolicyIDvalue (orundefined) for the invited-member path so the new fallback logic routes to the right report.What alternative solutions did you explore? (Optional)
An alternative is to introduce a dedicated
invitingPolicyWorkspaceChatReportIDparameter passed from the onboarding screens tonavigateAfterOnboardingfor the invite-link flow, navigating to it explicitly on completion — more targeted but requires threading the value through more call sites.MobileMage commentedon Jun 25, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
A user who is invited to a workspace and does not yet have an Expensify account clicks the link at the bottom of the invitation email, gets signed in without needing a magic code, and should land on the workspace chat referenced by the link. Instead, the deep-link target is dropped during the sign-in handoff and the invited member lands on the Home page (the LHN report list root).
What is the root cause of that problem?
The invitation link opens a NewDot report deep link (
/r/{reportID}for the workspace chat). On web,DeepLinkHandlercallsopenReportFromDeepLink, which defers navigation until the brand-new account finishes signing in viawaitForUserSignIn().then(...). Once signed in, navigation is gated on the user's onboarding state. Both gates that decide whetherhandleDeeplinkNavigationruns readnvp_onboarding.hasCompletedGuidedSetupFlow, and for an invited member the server sets that flag tofalse. The entry gate only invokes the navigation when the flag is truthy:App/src/libs/actions/Link.ts
Lines 394 to 396 in ab92615
hasCompletedGuidedSetupFlowSelectorreturns the rawfalsehere (it only coerces totruefor an empty/undefined NVP), so for an invited member the gate isfalseandhandleDeeplinkNavigationis never called. Even if it were, the#91437guard inside it drops any link captured pre-onboarding:if (initialHasCompletedGuidedSetupFlow === false) return;(line 348). That guard was added on the assumption thatnavigateAfterOnboardingowns the post-onboarding destination and will override the deep link anyway.That assumption does not hold for invited members. In
useOnboardingFlowRouter, an invited/group member (wasInvitedToNewDotorhasNonPersonalPolicy) returns early and the onboarding flow is never started, sonavigateAfterOnboardingnever runs for them:App/src/hooks/useOnboardingFlow.ts
Lines 84 to 88 in ab92615
So for an invited member there is no onboarding flow to take over navigation, and the deep link is the only thing that would route them to the workspace chat — but it gets suppressed because
hasCompletedGuidedSetupFlowisfalse. Nothing else navigates, so they remain on Home. This is distinct from thetransition/exitTopath (setUpPoliciesAndNavigate,LogOutPreviousUserPage); the invite email is a plain report deep link that flows throughopenReportFromDeepLink, where the earlyreturnat line 285 means only this function is responsible for the navigation.What changes do you think we should make in order to solve the problem?
Exclude invited members from the onboarding-completion gating in
openReportFromDeepLink, because for them the deep link is the sole navigation source and no onboarding flow will ever override it.openReportFromDeepLinkalready receivesintroSelectedas a parameter, so we can derivewasInvitedToNewDotSelector(introSelected)(which is justintroSelected?.inviteType !== undefined) without any new Onyx subscription, and import it alongside the existinghasCompletedGuidedSetupFlowSelectorfrom@src/selectors/Onboarding. We then let invited members through both gates — the entry gate at line 394 and the pre-onboarding drop at line 348:App/src/libs/actions/Link.ts
Lines 346 to 350 in ab92615
This is safe because it narrows the
#91437fix rather than reverting it: organic fresh sign-ups (noinviteType) still have their pre-onboarding deep link dropped sonavigateAfterOnboardingcan own the destination and the "Not here" flash is avoided. The change only affects users who were invited, who skip onboarding entirely, and for whom honoring the deep link is exactly the expected behavior described in the issue.navigateHandlerstill falls back to the last-accessed report or Concierge when the report does not exist, so a stale/inaccessible link cannot strand the user.What alternative solutions did you explore? (Optional)
Routing invited members through the
transition/exitTomechanism insetUpPoliciesAndNavigatewas considered, but the invite email is a plain/r/{reportID}deep link with noexitToquery param, so that path returns early at App.ts:838 and never fires — fixingopenReportFromDeepLink, where the link is actually handled, is the correct and minimal place.David-2002065 commentedon Jun 25, 2026
🚨 Edited by proposal-police: This proposal was edited at 2026-06-25 07:18:26 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
A workspace member who opens the email invite link lands on the Home page instead of being redirected to the workspace chat.
What is the root cause of that problem?
The invite link is a validate-login deep link with an
exitToparam (/v/<accountID>/<validateCode>?exitTo=<workspaceChat>). On web,ValidateLoginPageregisters the deferred destination navigation after sign-inApp/src/pages/ValidateLoginPage/index.web.tsx
Lines 134 to 136 in ab92615
which runs
handleExitToNavigation:App/src/libs/actions/Session/index.ts
Lines 1428 to 1435 in ab92615
A freshly invited member has not completed guided setup yet, so when the
navigate(exitTo)action is dispatched theOnboardingGuardevaluates it. The invited-member skip signals (hasNonPersonalPolicy/wasInvitedToNewDot) are read from module-level Onyx subscriptions that haven't been populated for the just-created account at that instant, soisInvitedOrGroupMemberisfalseApp/src/libs/Navigation/guards/OnboardingGuard.ts
Line 174 in ab92615
and with onboarding not completed,
shouldSkipOnboardingisfalse, so the guard returns aREDIRECTto the onboarding route and discards theexitTodestinationApp/src/libs/Navigation/guards/OnboardingGuard.ts
Lines 187 to 229 in ab92615
But during a validate-login flow the
OnboardingModalNavigatoris intentionally not mountedApp/src/libs/Navigation/AppNavigator/AuthScreens.tsx
Line 319 in ab92615
so the redirect to the onboarding route silently no-ops, leaving the user on the
ROUTES.HOMEroute that the precedinggoBack(ROUTES.HOME)already placed. Net effect: the member lands on Home instead of the workspace chat.What changes do you think we should make in order to solve the problem?
The
OnboardingGuardshould not hijack a navigation that is part of the validate-login /exitTodeep-link flow, mirroring whatAuthScreensalready does (it skips mounting the onboarding navigator duringNavigation.isValidateLoginFlow()). We add a skip signal toshouldSkipOnboardingApp/src/libs/Navigation/guards/OnboardingGuard.ts
Lines 187 to 196 in ab92615
This lets
navigate(exitTo)reach the workspace chat. For not-yet-onboarded invited members, onboarding is still correctly skipped in steady state byuseOnboardingFlow(which early-returns forisInvitedOrGroupMember), so no onboarding modal is wrongly shown.Alternatively (or additionally), we can fix
handleExitToNavigationso it never plants the user on Home: drop thegoBack(ROUTES.HOME)and navigate to the destination withforceReplaceto replace the consumed/v/route directlyApp/src/libs/actions/Session/index.ts
Lines 1428 to 1435 in ab92615
Note: the guard skip is still needed so the
exitTonavigation isn't redirected to onboarding while the member data is loading.What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
In
OnboardingGuard.test.ts, add a case where onboarding is not completed andisInvitedOrGroupMemberisfalsebut the current URL containsexitTo(validate-login flow): assert the guard returnsALLOWinstead ofREDIRECT, so theexitTodestination is preserved.What alternative solutions did you explore? (Optional)
We could gate the early-return in
OnboardingGuard.evaluateon the focused route beingSCREENS.VALIDATE_LOGIN, buthandleExitToNavigationcallsgoBack(ROUTES.HOME)beforenavigate(exitTo), so the focused route may already be Home by the time the guard runs; keying off theexitToURL param (as the existingisTransitioningcheck keys offTRANSITION_BETWEEN_APPS) is more reliable.melvin-bot commentedon Jun 25, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @hoangzinh (
External)[-]Web - Email - Member redirects to Home page instead of Workspace chat[/-][+][$250] Web - Email - Member redirects to Home page instead of Workspace chat[/+]melvin-bot commentedon Jun 25, 2026
Job added to Upwork: https://www.upwork.com/jobs/~022070041782240135206
neerajbachani commentedon Jun 25, 2026
proposal
59 remaining items
melvin-bot commentedon Aug 4, 2026
Triggered auto assignment to @mallenexpensify (
Awaiting Payment)melvin-bot commentedon Aug 4, 2026
Payment Summary
Upwork Job
BugZero Checklist (@mallenexpensify)
mallenexpensify commentedon Aug 7, 2026
Payment Summary
Contributor: @Abdulloh0109 paid $250 via Upwork
Contributor+: @hoangzinh due $250 via NewDot
@Abdulloh0109 can you please accept the job below? Please reply here and tag me once you have.
If you're not sent an offer in Upwork when you're assigned to an issue, please tag me. If an Upwork job exists, please submit a proposal.
https://www.upwork.com/jobs/~022085549837875469622
laurenreidexpensify commentedon Aug 10, 2026
$250 approved @hoangzinh
mallenexpensify commentedon Aug 10, 2026
@Abdulloh0109 paid, summary updated above. Thx.