Skip to content

fix: navigate to Concierge chat after login from Concierge deep link on web - #96387

Open
x-dev90 wants to merge 51 commits into
Expensify:mainfrom
x-dev90:fix/web-concierge-deep-link-login-navigation
Open

fix: navigate to Concierge chat after login from Concierge deep link on web#96387
x-dev90 wants to merge 51 commits into
Expensify:mainfrom
x-dev90:fix/web-concierge-deep-link-login-navigation

Conversation

@x-dev90

@x-dev90 x-dev90 commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Explanation of Change

Preserve the /concierge deep-link intent when a logged-out user signs up with a new account, then consume that intent after onboarding before falling back to Home.

This keeps the existing pre-onboarding deep-link guard intact, avoids reopening stale non-Concierge deep links, and routes the user to the Concierge report when available. If the Concierge report ID is not ready yet, it navigates to ROUTES.CONCIERGE so ConciergePage can resolve the chat.

Fixed Issues

$ #95365
PROPOSAL: #95365 (comment)

Tests

Case 1: Original Flow

  1. Log out of the app
  2. Open /concierge directly in the browser
  3. Sign up with a brand-new account
  4. Complete onboarding
  5. Verify the Concierge chat opens

Additional Cases

  1. Log out of the app.
  2. Open /concierge directly in the browser.
  3. Start signing up, but do not complete onboarding.
  4. In the same tab, navigate to /.
  5. Sign up normally from /.
  6. Complete onboarding.
  7. Verify the app follows the normal onboarding flow and does not open Concierge.

  1. Log out of the app.
  2. Open /.
  3. Sign up with a brand-new account.
  4. Complete onboarding.
  5. Verify the app follows the normal onboarding flow and does not open Concierge due to stale state.

  1. Log out of the app.
  2. Open /concierge/.
  3. Sign up with a brand-new account.
  4. Complete onboarding.
  5. Verify the Concierge chat opens.

  1. Log out of the app.
  2. Open /concierge?test=1.
  3. Sign up with a brand-new account.
  4. Complete onboarding.
  5. Verify the Concierge chat opens.

  1. Log out of the app.
  2. Open /concierge#test.
  3. Sign up with a brand-new account.
  4. Complete onboarding.
  5. Verify the Concierge chat opens.
  • Verify that no errors appear in the JS console

Offline tests

Same as tests.

QA Steps

Same as tests.

// TODO: These must be filled out, or the issue title must include "[No QA]."

  • Verify that no errors appear in the JS console

PR Author Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
    • I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • Android: Native
    • Android: mWeb Chrome
    • iOS: Native
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
  • I followed proper code patterns (see Reviewing the code)
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I followed the guidelines as stated in the Review Guidelines
  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))
  • If new assets were added or existing ones were modified, I verified that:
    • The assets are optimized and compressed (for SVG files, run npm run compress-svg)
    • The assets load correctly across all supported platforms.
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • I added unit tests for any new feature or bug fix in this PR to help automatically prevent regressions in this user flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.

Screenshots/Videos

Android: Native
Android: mWeb Chrome
Screen_Recording_20260717_182305_Chrome.mp4
iOS: Native
iOS: mWeb Safari
Screen.Recording.2026-07-17.at.6.33.33.PM.mp4
MacOS: Chrome / Safari
Screen.Recording.2026-07-17.at.5.56.41.PM.mp4

@codecov

codecov Bot commented Jul 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ Changes either increased or maintained existing code coverage, great job!

Files with missing lines Coverage Δ
src/hooks/useAutoCreateSubmitWorkspace.ts 95.00% <100.00%> (+0.26%) ⬆️
src/libs/PendingConciergeDeepLink.ts 100.00% <100.00%> (ø)
src/libs/actions/SignInRedirect.ts 74.07% <100.00%> (+0.48%) ⬆️
src/libs/navigateAfterOnboarding.ts 89.47% <100.00%> (+1.97%) ⬆️
.../OnboardingWorkspaces/BaseOnboardingWorkspaces.tsx 97.33% <100.00%> (+0.03%) ⬆️
src/libs/actions/Link.ts 52.35% <88.88%> (+1.06%) ⬆️
... and 10 files with indirect coverage changes

@x-dev90
x-dev90 marked this pull request as ready for review July 17, 2026 13:58
@x-dev90
x-dev90 requested review from a team as code owners July 17, 2026 13:58
@melvin-bot
melvin-bot Bot requested review from brunovjk and flaviadefaria July 17, 2026 13:58
@melvin-bot

melvin-bot Bot commented Jul 17, 2026

Copy link
Copy Markdown

@brunovjk Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button]

@melvin-bot
melvin-bot Bot removed request for a team July 17, 2026 13:58
Comment thread src/libs/PendingConciergeDeepLink.ts

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f870138760

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/libs/PendingConciergeDeepLink.ts
@x-dev90

x-dev90 commented Jul 18, 2026

Copy link
Copy Markdown
Contributor Author

Hi @brunovjk, I tested one additional edge case and would like to confirm the expected behavior.

Steps:

  1. Log out.
  2. Open /concierge.
  3. Before completing signup/onboarding, open /.
  4. Complete signup/onboarding.

I also tested this on main, and the app still navigates to Concierge after onboarding. So this behavior does not seem to be introduced by this PR.

My understanding is that the app currently preserves the original /concierge signup deep-link intent through onboarding, and visiting / before onboarding completes does not cancel it.

Could you please confirm how we should handle this? Should this PR keep the current main behavior and only fix the reported Concierge onboarding issue, or should we also update the behavior so opening / explicitly cancels the pending Concierge intent?

Tested on main:

Screencast.From.2026-07-18.22-40-19.mp4

@x-dev90

x-dev90 commented Jul 18, 2026

Copy link
Copy Markdown
Contributor Author

Hi @brunovjk, just following up on this PR.

I addressed the AI feedback by persisting the pending Concierge deep-link intent in sessionStorage, so it can survive a tab reload during signup/onboarding and still be cleared through the existing consume/sign-out paths.

Could you please review the latest changes when you have a chance?

@brunovjk

Copy link
Copy Markdown
Contributor

@x-dev90 It’s not very consistent, so I couldn't record a video, but it happens sometimes. If you access the deeplink with /concierge and—before entering the new acc—you go to / instead, causing a normal signup to open Concierge instead of Workspace settings page. I think this happens because / is a public route, so clearPendingConciergeDeepLink() isn’t called. Could you take a look and let me know what you think?

Also, If you enter using only the / deeplink, select "Something else" during onboarding, and complete the process, you are redirected to /concierge instead of Home:

Screen.Recording.2026-07-20.at.14.33.42.mov

@x-dev90

x-dev90 commented Jul 21, 2026

Copy link
Copy Markdown
Contributor Author

@x-dev90 It’s not very consistent, so I couldn't record a video, but it happens sometimes. If you access the deeplink with /concierge and—before entering the new acc—you go to / instead, causing a normal signup to open Concierge instead of Workspace settings page. I think this happens because / is a public route, so clearPendingConciergeDeepLink() isn’t called. Could you take a look and let me know what you think?

Also, If you enter using only the / deeplink, select "Something else" during onboarding, and complete the process, you are redirected to /concierge instead of Hom

Hi @brunovjk ,I updated the implementation to preserve the pending /concierge intent across page reloads using tab-scoped sessionStorage, while still allowing an explicit root/Home navigation to cancel that intent. I also handled generated root/Home startup events so they do not incorrectly override an existing pending Concierge intent.

I added focused unit coverage for the Concierge redirect, explicit root cancellation, direct root signup, and reload cases. I also adjusted the reload detection to avoid direct deprecated API access.

Could you please review again when you have a chance?

Thank you!

After Fix:

Screencast.From.2026-07-22.01-34-13.mp4
Screencast.From.2026-07-22.01-31-38.mp4
Screencast.From.2026-07-22.01-36-26.mp4
Screencast.From.2026-07-22.01-37-43.mp4

@brunovjk

Copy link
Copy Markdown
Contributor

Thanks for the effort @x-dev90, but now it seems to be failing on the initial issue:

Screen.Recording.2026-07-22.at.13.38.18.mov

@x-dev90

x-dev90 commented Aug 8, 2026

Copy link
Copy Markdown
Contributor Author

Hey @x Developer, I think this PR has started drifting beyond the original issue scope. I’d like us to align on whether we should bring it back to the original approved proposal and handle any existing main bugs separately.

Hi @brunovjk, I’ve cleaned up the PR so the implementation is now focused on the original proposal.

It preserves the pending /concierge signup deep-link intent, consumes it after onboarding before the normal onboarding destinations, and clears it on sign-out.

Could you please take another look when you have a chance? thanks.

@x-dev90

x-dev90 commented Aug 10, 2026

Copy link
Copy Markdown
Contributor Author

@brunovjk, just a gentle bump. Thanks!

@brunovjk

Copy link
Copy Markdown
Contributor

Hi @x-dev90, quick question: I noticed the Url.hasSecureLinkKey(...) block in openReportFromDeepLink was removed. Was that intentional? That logic handled secure-link joins and may be a regression if dropped. Thank you.

@x-dev90

x-dev90 commented Aug 10, 2026

Copy link
Copy Markdown
Contributor Author

Hi @x-dev90, quick question: I noticed the Url.hasSecureLinkKey(...) block in openReportFromDeepLink was removed. Was that intentional? That logic handled secure-link joins and may be a regression if dropped. Thank you.

Hi @brunovjk, thanks for the review.

I restored the unrelated changes and kept the PR scoped to the /concierge flow. The current changes only preserve the pending /concierge deep-link intent during signup/onboarding, consume it before the normal onboarding destinations, and clear it on sign-out.

I also restored the unrelated secure-link handling, existing onboarding navigation behavior, and test mocks. Could you please review again when you have a chance?

@brunovjk

Copy link
Copy Markdown
Contributor

Reviewer Checklist

  • I have verified the author checklist is complete (all boxes are checked off).
  • I verified the correct issue is linked in the ### Fixed Issues section above
  • I verified testing steps are clear and they cover the changes made in this PR
    • I verified the steps for local testing are in the Tests section
    • I verified the steps for Staging and/or Production testing are in the QA steps section
    • I verified the steps cover any possible failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
  • I checked that screenshots or videos are included for tests on all platforms
  • I included screenshots or videos for tests on all platforms
  • I verified that the composer does not automatically focus or open the keyboard on mobile unless explicitly intended. This includes checking that returning the app from the background does not unexpectedly open the keyboard.
  • I verified tests pass on all platforms & I tested again on:
    • Android: HybridApp
    • Android: mWeb Chrome
    • iOS: HybridApp
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • If there are any errors in the console that are unrelated to this PR, I either fixed them (preferred) or linked to where I reported them in Slack
  • I verified proper code patterns were followed (see Reviewing the code)
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I verified that this PR follows the guidelines as stated in the Review Guidelines
  • I verified other components that can be impacted by these changes have been tested, and I retested again (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar have been tested & I retested again)
  • If a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately
    • The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
    • The only data being stored in the state is data necessary for rendering and nothing else
    • The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • For any bug fix or new feature in this PR, I verified that sufficient unit tests are included to prevent regressions in this flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.
  • I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.

Screenshots/Videos

Android: HybridApp
Android: mWeb Chrome
iOS: HybridApp
iOS: mWeb Safari
MacOS: Chrome / Safari

/concierge signup with workspace onboarding

96387_web_chrome_workspace.mov

/concierge signup after refresh during onboarding

96387_web_chrome_refresh_onboarding.mov

/concierge/ signup route variant

96387_web_chrome_.concierge.mov

/concierge?test=1 signup route variant

96387_web_chrome_.concierge.test.1.mov

@brunovjk

Copy link
Copy Markdown
Contributor

@cristipaval could you please help confirm the expected behavior here?

I retested the latest PR and found:

  • /concierge → new signup → normal onboarding: lands in Concierge ✅
  • /concierge/, /concierge?test=1, /concierge#test: all land in Concierge ✅
  • /concierge → navigate to / before signup → complete signup: lands on the default onboarding destination, not Concierge ✅
  • /concierge → new signup → onboarding flow that creates a workspace: lands in Concierge instead of workspaces/overview

The PR looks good to me otherwise, but I’m unsure about the last case. Should the original /concierge intent override the workspace onboarding destination, or should workspace creation keep its normal destination (workspaces/overview)?

@cristipaval

Copy link
Copy Markdown
Contributor

@cristipaval could you please help confirm the expected behavior here?

I retested the latest PR and found:

  • /concierge → new signup → normal onboarding: lands in Concierge ✅
  • /concierge/, /concierge?test=1, /concierge#test: all land in Concierge ✅
  • /concierge → navigate to / before signup → complete signup: lands on the default onboarding destination, not Concierge ✅
  • /concierge → new signup → onboarding flow that creates a workspace: lands in Concierge instead of workspaces/overview

The PR looks good to me otherwise, but I’m unsure about the last case. Should the original /concierge intent override the workspace onboarding destination, or should workspace creation keep its normal destination (workspaces/overview)?

@flaviadefaria could you please confirm from the product perspective?

@x-dev90

x-dev90 commented Aug 14, 2026

Copy link
Copy Markdown
Contributor Author

@flaviadefaria could you please confirm from the product perspective?

Hi @flaviadefaria, could you please verify this from the product perspective? Thanks!

@x-dev90

x-dev90 commented Aug 17, 2026

Copy link
Copy Markdown
Contributor Author

@flaviadefaria, gentle bump on this comment. Thanks!

@flaviadefaria

Copy link
Copy Markdown
Contributor

Sorry I was OoO last week and am only catching up now. I might be missing something, but I’d expect any new sign-up to be routed through the onboarding flow, regardless of the link they used. If it’s a brand-new account, I’d assume they only ended up with the Concierge link by mistake, so onboarding should take precedence. For an existing account, though, I agree that the user should land directly in the Concierge chat.

@trjExpensify cc'ing you here for a buddy check, as I might be missing something.

@trjExpensify

Copy link
Copy Markdown
Contributor

Yeah, I assume we created this new.expensify.com/concierge deep link for support reasons at some point? (i.e it's easier to send people that vs figuring out their unique chatReportID of their Concierge DM).

I don't really see the utility of the deep link for a brand new user, so I'd be open to just dropping it for brand new accounts and proceeding through onboarding as normal in all cases.

@x-dev90

x-dev90 commented Aug 18, 2026

Copy link
Copy Markdown
Contributor Author

Yeah, I assume we created this new.expensify.com/concierge deep link for support reasons at some point? (i.e it's easier to send people that vs figuring out their unique chatReportID of their Concierge DM).

I don't really see the utility of the deep link for a brand new user, so I'd be open to just dropping it for brand new accounts and proceeding through onboarding as normal in all cases.

@brunovjk, what’s the next step here? Thanks!

@mountiny

Copy link
Copy Markdown
Contributor

I think this deeplink existed so we can add this kink to olddot and support pages and its generic and makes sense to the reader

@x-dev90

x-dev90 commented Aug 19, 2026

Copy link
Copy Markdown
Contributor Author

@brunovjk, just a gentle bump. Thanks!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants