Skip to content

Fix: Session Expired page "Please sign in again" link does nothing#96386

Open
MelvinBot wants to merge 1 commit into
mainfrom
claude-sessionExpiredSignInLink
Open

Fix: Session Expired page "Please sign in again" link does nothing#96386
MelvinBot wants to merge 1 commit into
mainfrom
claude-sessionExpiredSignInLink

Conversation

@MelvinBot

@MelvinBot MelvinBot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Explanation of Change

On the "Session Expired" page (shown when an OldDot→NewDot transition link is opened with an expired auth token), clicking Please sign in again did nothing. The link's handler called Navigation.goBack() with no fallback route. When the transition link is pasted into a fresh tab, /transition is the only entry in the navigation stack, so canGoBack() is false and goBack() hits its early-return guard ([Navigation] Unable to go back) — a no-op. clearSignInData() still ran, but the route never changed, so the page appeared to do nothing.

This passes an explicit fallback route, Navigation.goBack(ROUTES.HOME). With a backToRoute provided, goBack skips the no-op guard and routes through goUp(ROUTES.HOME); since ROUTES.HOME isn't present in the single-route /transition stack, it dispatches a REPLACE to Home. Because clearSignInData() has already cleared the session, Home resolves to the public sign-in screen — the expected redirect. It still correctly pops when back history exists (e.g. reached from within the app), so the warm-history case is unchanged. This mirrors the existing goBackToHome() helper and the LogOutPreviousUserPage transition-flow precedent, which both use goBack(ROUTES.HOME).

Fixed Issues

$ #96344
PROPOSAL:#96344 (comment)

Tests

  1. Sign in on OldDot (e.g. https://www.expensify.com/).
  2. Click Settings > Contact Concierge (or any action that generates an OldDot→NewDot transition link).
  3. Copy the transition link and close the tab.
  4. Log out of NewDot.
  5. Wait 1–2 minutes so the auth token in the transition link expires.
  6. Paste the transition link into NewDot and open it.
  7. On the Session Expired page, click Please sign in again.
  8. Verify you are redirected to the sign-in page.
  9. Verify that no errors appear in the JS console.
  • Verify that no errors appear in the JS console

Offline tests

QA Steps

  1. Sign in on OldDot (e.g. https://staging.expensify.com/).
  2. Click Settings > Contact Concierge (or any action that generates an OldDot→NewDot transition link).
  3. Copy the transition link and close the tab.
  4. Log out of NewDot.
  5. Wait 1–2 minutes so the auth token in the transition link expires.
  6. Paste the transition link into NewDot and open it.
  7. On the Session Expired page, click Please sign in again.
  8. Verify you are redirected to the sign-in page.
  9. 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
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari

Co-authored-by: Maruf Sharifi <marufsharifi@users.noreply.github.com>
@MelvinBot

Copy link
Copy Markdown
Contributor Author

I looked into the failing checks — there's no code fix to push. Every substantive check passes: ESLint, typecheck, knip, Oxfmt, React Compiler, all 8 test jobs, Storybook, Bun tests, spellcheck, and the builds.

The only failing check is checklist (PR Author Checklist), and that's not a code issue — it fails because the checklist boxes in the PR description aren't ticked:

You completed 0 out of 38 checklist items with 38 unfinished items
PR Author Checklist is not completely filled out.

This one is a manual author task — I can't complete it for you, since checking those boxes is you attesting that you actually did each item (tested on all platforms, verified no console errors, added tests, etc.). Once you tick the boxes that apply and fill in the Tests/QA Steps sections, that check will pass on the next run.

The baseline-perf-tests / branch-perf-tests were still running when I checked — those are benchmark comparisons and aren't affected by a one-line navigation-fallback change, so no action needed there.

If a check does fail for a real reason once perf finishes, re-tag me and I'll dig in.

@marufsharifi

Copy link
Copy Markdown
Contributor

@MelvinBot, add proper QA Test steps based on issue description

@MelvinBot

Copy link
Copy Markdown
Contributor Author

🤖 Added QA steps (and matching local Test steps) to the PR body, derived from the reproduction in #96344:

  1. Sign in on OldDot.
  2. Generate an OldDot→NewDot transition link (e.g. Settings > Contact Concierge).
  3. Copy the transition link and close the tab.
  4. Log out of NewDot.
  5. Wait 1–2 minutes so the transition link's auth token expires.
  6. Paste the transition link into NewDot and open it.
  7. On the Session Expired page, click Please sign in again.
  8. Verify you are redirected to the sign-in page.
  9. Verify no errors appear in the JS console.

Please review and adjust as needed.

@MelvinBot

Copy link
Copy Markdown
Contributor Author

The only failing check is PR Author Checklist / checklist — every code, test, lint, and build check is passing. ✅

This isn't a code failure, so there's nothing for me to push a fix for. The check fails because the PR Author Checklist in the description isn't fully checked off:

PR Author Checklist is not completely filled out. Please check every box to verify you've thought about the item.

To clear it: open the PR description and tick every box in the author checklist (and confirm the required screenshots/tests sections are filled in). The check re-runs automatically once the boxes are checked.

Since checklist completion requires a human author to confirm each item, I can't check those boxes for you.

@marufsharifi

Copy link
Copy Markdown
Contributor

@MelvinBot, mark this as ready for review

@MelvinBot
MelvinBot marked this pull request as ready for review July 18, 2026 06:57
@MelvinBot
MelvinBot requested a review from a team as a code owner July 18, 2026 06:57
@melvin-bot
melvin-bot Bot requested review from heyjennahay and marufsharifi and removed request for a team July 18, 2026 06:57
@melvin-bot

melvin-bot Bot commented Jul 18, 2026

Copy link
Copy Markdown

@marufsharifi 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 the request for review from a team July 18, 2026 06:57
@MelvinBot

Copy link
Copy Markdown
Contributor Author

🤖 Marked this PR as ready for review.

@marufsharifi

Copy link
Copy Markdown
Contributor

@MelvinBot, replace the PR author checklist with below verified one:

PR author checklist

<!-- If necessary, assign reviewers that know the area or changes well. Feel free to tag any additional reviewers you see fit. -->

### Explanation of Change
<!-- Explain what your change does and how it addresses the linked issue -->

On the "Session Expired" page (shown when an OldDot→NewDot transition link is opened with an expired auth token), clicking Please sign in again did nothing. The link's handler called `Navigation.goBack()` with no fallback route. When the transition link is pasted into a fresh tab, `/transition` is the only entry in the navigation stack, so `canGoBack()` is `false` and `goBack()` hits its early-return guard (`[Navigation] Unable to go back`) — a no-op. `clearSignInData() `still ran, but the route never changed, so the page appeared to do nothing.

This passes an explicit fallback route, `Navigation.goBack(ROUTES.HOME)`. With a `backToRoute` provided, `goBack `skips the no-op guard and routes through `goUp(ROUTES.HOME)`; since `ROUTES.HOME` isn't present in the single-route `/transition` stack, it dispatches a `REPLACE` to Home. Because `clearSignInData()` has already cleared the session, Home resolves to the public sign-in screen — the expected redirect. It still correctly pops when back history exists (e.g. reached from within the app), so the warm-history case is unchanged. This mirrors the existing `goBackToHome()` helper and the `LogOutPreviousUserPage` transition-flow precedent, which both use `goBack(ROUTES.HOME)`.

### Fixed Issues
<!---
1. Please postfix `$` with a URL link to the GitHub issue this Pull Request is fixing. For example, `$ https://github.com/Expensify/App/issues/<issueID>`.
2. Please postfix  `PROPOSAL:` with a URL link to your GitHub comment, which contains the approved proposal (i.e. the proposal that was approved by Expensify).  For example, `PROPOSAL: https://github.com/Expensify/App/issues/<issueID>#issuecomment-1369752925`

Do NOT add the special GH keywords like `fixed` etc, we have our own process of managing the flow.
It MUST be an entire link to the github issue and your comment proposal ; otherwise, the linking and its automation will not work as expected.

Make sure this section looks similar to this (you can link multiple issues using the same formatting, just add a new line):

$ https://github.com/Expensify/App/issues/<issueID>
$ https://github.com/Expensify/App/issues/<issueID(comment)>

Do NOT only link the issue number like this: $ #<issueID>
--->
$ https://github.com/Expensify/App/issues/96344
PROPOSAL:https://github.com/Expensify/App/issues/96344#issuecomment-4995672506

<!--- 
If you want to trigger adhoc build of hybrid app from specific Mobile-Expensify PR please link it like this:

MOBILE-EXPENSIFY: https://github.com/Expensify/Mobile-Expensify/pull/<PR-number>

--->

### Tests
<!---
Add a numbered list of manual tests you performed that validates your changes work on all platforms, and that there are no regressions present.
Add any additional test steps if test steps are unique to a particular platform.
Manual test steps should be written so that your reviewer can repeat and verify one or more expected outcomes in the development environment.

For example:
1. Click on the text input to bring it into focus
2. Upload an image via copy paste
3. Verify a modal appears displaying a preview of that image
--->

1. Sign in on OldDot (e.g. https://www.expensify.com/).
2. Click Settings > Contact Concierge (or any action that generates an OldDot→NewDot transition link).
3. Copy the transition link and close the tab.
4. Log out of NewDot.
5. Wait 1–2 minutes so the auth token in the transition link expires.
6. Paste the transition link into NewDot and open it.
7. On the Session Expired page, click Please sign in again.
8. Verify you are redirected to the sign-in page.
9. Verify that no errors appear in the JS console.

- [x] Verify that no errors appear in the JS console

### Offline tests
<!---
Add any relevant steps that validate your changes work as expected in a variety of network states e.g. "offline", "spotty connection", "slow internet", etc. Manual test steps should be written so that your reviewer and QA testers can repeat and verify one or more expected outcomes. If you are unsure how the behavior should work ask for advice in the `#expensify-open-source` Slack channel.
--->



### QA Steps
<!---
Add a numbered list of manual tests that can be performed by our QA engineers on the staging environment to validate that your changes work on all platforms, and that there are no regressions present.
Add any additional QA steps if test steps are unique to a particular platform.
Manual test steps should be written so that the QA engineer can repeat and verify one or more expected outcomes in the staging environment.

For example:
1. Click on the text input to bring it into focus
2. Upload an image via copy paste
3. Verify a modal appears displaying a preview of that image

It's acceptable to write "Same as tests" if the QA team is able to run the tests in the above "Tests" section.
--->

1. Sign in on OldDot (e.g. https://staging.expensify.com/).
2. Click Settings > Contact Concierge (or any action that generates an OldDot→NewDot transition link).
3. Copy the transition link and close the tab.
4. Log out of NewDot.
5. Wait 1–2 minutes so the auth token in the transition link expires.
6. Paste the transition link into NewDot and open it.
7. On the Session Expired page, click Please sign in again.
8. Verify you are redirected to the sign-in page.
9. Verify that no errors appear in the JS console.


### PR Author Checklist
<!--
This is a checklist for PR authors. Please make sure to complete all tasks and check them off once you do, or else your PR will not be merged!
-->

- [x] I linked the correct issue in the `### Fixed Issues` section above
- [x] I wrote clear testing steps that cover the changes made in this PR
    - [x] I added steps for local testing in the `Tests` section
    - [x] I added steps for the expected offline behavior in the `Offline steps` section
    - [x] I added steps for Staging and/or Production testing in the `QA steps` section
    - [x] I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    - [x] 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)
    - [x] I tested this PR with a [High Traffic account](https://github.com/Expensify/App/blob/main/contributingGuides/CONTRIBUTING.md#high-traffic-accounts) against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
- [x] I included screenshots or videos for tests on [all platforms](https://github.com/Expensify/App/blob/main/contributingGuides/CONTRIBUTING.md#make-sure-you-can-test-on-all-platforms)
- [x] I ran the tests on **all platforms** & verified they passed on:
    - [x] Android: Native
    - [x] Android: mWeb Chrome
    - [x] iOS: Native
    - [x] iOS: mWeb Safari
    - [x] MacOS: Chrome / Safari
- [x] 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)
- [x] I followed proper code patterns (see [Reviewing the code](https://github.com/Expensify/App/blob/main/contributingGuides/PR_REVIEW_GUIDELINES.md#reviewing-the-code))
    - [x] I verified that comments were added to code that is not self explanatory
    - [x] 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.
    - [x] 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)
- [x] If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
- [x] I followed the guidelines as stated in the [Review Guidelines](https://github.com/Expensify/App/blob/main/contributingGuides/PR_REVIEW_GUIDELINES.md)
- [x] 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)
- [x] If a new CSS style is added I verified that:
    - [x] A similar style doesn't already exist
    - [x] The style can't be created with an existing [StyleUtils](https://github.com/Expensify/App/blob/main/src/styles/utils/index.ts) function (i.e. `StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)`)
- [x] If new assets were added or existing ones were modified, I verified that:
    - [x] The assets are optimized and compressed (for SVG files, run `npm run compress-svg`)
    - [x] The assets load correctly across all supported platforms.
- [x] 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.
- [x] 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)
- [x] 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.
- [x] 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.
- [x] 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:
    - [x] I verified that all the inputs inside a form are aligned with each other.
    - [x] I added `Design` label and/or tagged `@Expensify/design` so the design team can review the changes.
- [x] I added [unit tests](https://github.com/Expensify/App/blob/main/tests/README.md) for any new feature or bug fix in this PR to help automatically prevent regressions in this user flow.
- [x] 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
<details>
<summary>Android: Native</summary>

<!-- add screenshots or videos here -->

</details>

<details>
<summary>Android: mWeb Chrome</summary>

<!-- add screenshots or videos here -->

</details>

<details>
<summary>iOS: Native</summary>

<!-- add screenshots or videos here -->

</details>

<details>
<summary>iOS: mWeb Safari</summary>

<!-- add screenshots or videos here -->

</details>

<details>
<summary>MacOS: Chrome / Safari</summary>

<!-- add screenshots or videos here -->

</details>


@MelvinBot

Copy link
Copy Markdown
Contributor Author

🤖 Done — replaced the PR body with your verified version, including the completed PR Author Checklist.

@marufsharifi

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

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.

2 participants