Skip to content

Auth: fix verify page stuck on spinner under StrictMode#50

Open
RandyJDean wants to merge 1 commit into
07-09-auth_document_the_magic-link_featurefrom
07-09-auth_fix_verify_page_stuck_on_spinner_under_strictmode
Open

Auth: fix verify page stuck on spinner under StrictMode#50
RandyJDean wants to merge 1 commit into
07-09-auth_document_the_magic-link_featurefrom
07-09-auth_fix_verify_page_stuck_on_spinner_under_strictmode

Conversation

@RandyJDean

Copy link
Copy Markdown
Contributor

The verify POST fired from a mount effect via useMutation, and
StrictMode's simulated remount detaches the mutation observer from its
in-flight request — the component never saw success (no navigation,
spinner forever) even though the backend signed the user in.

Model the token exchange as a query keyed by the token instead: the
StrictMode double-mount dedupes to a single POST and the remounted
observer re-attaches to the cached entry. The page now derives
navigation from query state, dropping the effect + ref guard entirely.

Wrap the test renderer in StrictMode to mirror main.tsx so this class
of bug fails in vitest instead of only in the browser.

Co-Authored-By: Claude Fable 5 noreply@anthropic.com

The verify POST fired from a mount effect via useMutation, and
StrictMode's simulated remount detaches the mutation observer from its
in-flight request — the component never saw success (no navigation,
spinner forever) even though the backend signed the user in.

Model the token exchange as a query keyed by the token instead: the
StrictMode double-mount dedupes to a single POST and the remounted
observer re-attaches to the cached entry. The page now derives
navigation from query state, dropping the effect + ref guard entirely.

Wrap the test renderer in StrictMode to mirror main.tsx so this class
of bug fails in vitest instead of only in the browser.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

RandyJDean commented Jul 9, 2026

Copy link
Copy Markdown
Contributor Author

@sonarqubecloud

sonarqubecloud Bot commented Jul 9, 2026

Copy link
Copy Markdown

@RandyJDean RandyJDean marked this pull request as ready for review July 10, 2026 18:47
@RandyJDean RandyJDean requested a review from a team as a code owner July 10, 2026 18:47
@graphite-app graphite-app Bot requested review from Arshadul-Monir and arklian July 10, 2026 18:47
@graphite-app

graphite-app Bot commented Jul 10, 2026

Copy link
Copy Markdown

Graphite Automations

"Request reviewers once CI passes" took an action on this PR • (07/10/26)

2 reviewers were added to this PR based on Henry Chen's automation.

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.

1 participant