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.

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 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.

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