Skip to content

Preserve Search report links after workspace-member sign-in - #105710

Merged
roryabraham merged 5 commits into
mainfrom
triage/105211-search-report-sign-in
Nov 3, 2026
Merged

roryabraham merged 5 commits into
mainfrom
triage/105211-search-report-sign-in

Conversation

@roryabraham

@roryabraham roryabraham commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Explanation of Change

Opening a Search report link while signed out could leave workspace members on Spend after signing in, rather than opening the report. These members don't need to complete onboarding, but the deep-link handler was still waiting for hasCompletedGuidedSetupFlow to become true.

This change opens the requested report once the member has signed in and navigation is ready, keeping any linked comment and query parameters. It still waits for an onboarding flow that's already open, and clears pending links on sign-out so they can't reopen for another account.

Fixed Issues

$ #105211
PROPOSAL: N/A

Tests

Set up the accounts and invoice

For local testing, set SKIP_ONBOARDING=false in .env.

  1. Sign in to an existing workspace-admin account in a normal window. Call this account Admin.
  2. Open the app in an incognito window and register a new account using an unused email address. Enter the email, click Continue, then Join. Call this account Member.
  3. Stop at the first setup question, such as “What’s your work email?” Leave that page open without clicking Skip, Continue, or completing any setup steps. This is what “incomplete onboarding” means for this test.
  4. In the Admin session, open Workspaces → your workspace → Members → Invite member and invite Member's email with the Member role.
  5. In that workspace, open More features and enable Invoices if it isn't already enabled.
  6. As Admin, use + → Send invoice to send Member a small test invoice from that workspace. Complete the required invoice and company information if prompted.
  7. In the invoice list shown after sending, open the new invoice and copy its URL. Save the ID immediately after /search/view/ or /search/r/ as INVOICE_REPORT_ID.
  8. Close all private windows, then open a new private window and sign in as Member. Do not complete onboarding: workspace membership should now let this account enter the app without the setup questions.
  9. Open the invoice using the URL from step 7 and confirm Member can see it.
  10. Add a comment with the text “Deep-link test comment” to the invoice conversation.
  11. Right-click the comment (or press and hold on touch) and select Copy link. The copied URL ends in /r/<reportID>/<reportActionID>. Save those two IDs as COMMENT_REPORT_ID and COMMENT_ACTION_ID; the comment's report ID can differ from the invoice's report ID.

Check links opened while signed out

Prefix each path below with the app's base URL and replace the IDs with the values saved above. Paste the full URL into the address bar rather than navigating through the app.

  1. In Member's session, select Account → Sign out.
  2. Open /search/r/INVOICE_REPORT_ID and sign in as Member.
  3. Verify the invoice opens, rather than leaving Member on the default Spend page.
  4. Sign out again, open /search/view/INVOICE_REPORT_ID, and sign in as Member. Verify the same invoice opens.
  5. Sign out again, open /search/view/COMMENT_REPORT_ID/COMMENT_ACTION_ID, and sign in as Member. Verify “Deep-link test comment” is visible and highlighted.
  6. Repeat the previous step with a narrow window, where the main navigation appears along the bottom, and verify the comment is still visible and highlighted.

Check existing behavior

  1. Sign out, open /r/COMMENT_REPORT_ID/COMMENT_ACTION_ID, and sign in as Member. Verify the comment opens in Inbox.
  2. While still signed in, open /search/view/COMMENT_REPORT_ID/COMMENT_ACTION_ID?backTo=search%3Fq%3Dtype%3Ainvoice. Verify the comment opens and the URL retains the backTo parameter.
  3. Sign out as Member and sign in as Admin without opening another report link. Verify the old invoice/comment does not reopen automatically.
  • Verify that no errors appear in the JS console

Offline tests

None.

QA Steps

Same as tests.

  • 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 verified there are no new alerts related to the canBeMissing param for useOnyx
  • I followed proper code patterns (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick)
    • 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 shown in the product is localized by adding it to src/languages/* files and using the translation method
      • If any non-english text was added/modified, I used JaimeGPT to get English > Spanish translation. I then posted it in #expensify-open-source and it was approved by an internal Expensify engineer. Link to Slack message:
    • I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
    • 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)
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • 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)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.ts or at the top of the file that uses the constant) are defined as such
  • I verified that if a function's arguments changed that all usages have also been updated correctly
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • 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.
  • If a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
  • 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

Not tested.

Android: mWeb Chrome

Not tested.

iOS: Native

Not tested.

iOS: mWeb Safari

Not tested.

MacOS: Chrome / Safari

Each pair shows the same workspace member opening the same invoice link before and after the change.

Search invoice report — before

red-member-invoice-search-r.webm

Search invoice report — after

green-member-invoice-search-r.webm

Search view — before

red-member-invoice-view.webm

Search view — after

green-member-invoice-view.webm

Linked comment, wide layout — before

red-member-invoice-view-action.webm

Linked comment, wide layout — after

green-member-invoice-view-action.webm

Linked comment, narrow layout — before

red-member-invoice-view-action-narrow.webm

Linked comment, narrow layout — after

green-member-invoice-view-action-narrow.webm

The six new regression cases intentionally fail until replay supports\nworkspace members whose onboarding flag remains false.
@roryabraham
roryabraham requested a review from a team November 3, 2026 04:38
@roryabraham

This comment has been minimized.

@chatgpt-codex-connector

This comment has been minimized.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

@roryabraham

Copy link
Copy Markdown
Contributor Author

@codex review

@codecov

codecov Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Codecov Report

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

Files with missing lines Coverage Δ
src/libs/actions/Link.ts 72.02% <95.08%> (+3.03%) ⬆️
... and 213 files with indirect coverage changes

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

Reviewed commit: ca84d8e249

ℹ️ 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".

@roryabraham
roryabraham marked this pull request as ready for review November 3, 2026 05:50
@roryabraham
roryabraham requested a review from a team as a code owner November 3, 2026 05:50
@melvin-bot
melvin-bot Bot requested review from dmkt9 and removed request for a team November 3, 2026 05:50
@melvin-bot

melvin-bot Bot commented Nov 3, 2026

Copy link
Copy Markdown

@dmkt9 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]

@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

This PR adds a new Onyx.connectWithoutView call, so I've requested a review from the Onyx performance reviewers (@tgolen, @mountiny, @luacmartins, @chuckdries) — a review from any one of them is enough. Please add a link in your PR description to the Slack discussion where the @frontend-performance team approved using connectWithoutView here.

@dmkt9

dmkt9 commented Nov 3, 2026 •

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 any copy / text that was added to the app 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 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 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.
  • If the PR adds or modifies the UI:
    • I asked an AI agent to review the changes for accessibility issues and addressed its findings.
    • I tested with a screen reader (VoiceOver on macOS) and verified all new/changed elements are reachable with a logical focus order.
    • I verified all new/changed elements have meaningful accessible names and roles.
    • I verified state changes are announced (e.g. checked/unchecked, expanded/collapsed, selected).
  • 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
chrome.mp4

Comment thread src/libs/actions/Link.ts Resolved
@roryabraham
roryabraham requested a review from a team as a code owner November 3, 2026 15:06
@melvin-bot
melvin-bot Bot requested a review from situchan November 3, 2026 15:06
@melvin-bot
melvin-bot Bot removed the request for review from a team November 3, 2026 15:06
@melvin-bot

melvin-bot Bot commented Nov 3, 2026

Copy link
Copy Markdown

@situchan 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]

@dmkt9 dmkt9 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@roryabraham
roryabraham merged commit 5d284bc into main Nov 3, 2026
46 of 48 checks passed
@roryabraham
roryabraham deleted the triage/105211-search-report-sign-in branch November 3, 2026 16:19
@OSBotify

OSBotify commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

🚧 roryabraham has triggered a test Expensify/App build. You can view the workflow run here.

@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

@OSBotify OSBotify mentioned this pull request Nov 3, 2026
99 tasks done
@OSBotify

OSBotify commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by https://github.com/roryabraham in version: 9.5.31-0 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 failure ❌
🍎 iOS 🍎 success ✅

@MelvinBot

Copy link
Copy Markdown
Contributor

No help site update needed — this fixes report and comment links opening after sign-in, restoring expected behavior without introducing a new workflow or making existing guidance incorrect.

@OSBotify

OSBotify commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by https://github.com/roryabraham in version: 9.5.31-0 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

@OSBotify

OSBotify commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/blimpich in version: 9.5.31-4 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

Bundle Size Analysis (Sentry):

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.

5 participants