FE-1097: Fix post-signup loop possibility#8918
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
PR SummaryMedium Risk Overview In
After signup or invite acceptance, Reviewed by Cursor Bugbot for commit 86076bd. Bugbot is set up for automated code reviews on this repo. Configure here. |
There was a problem hiding this comment.
Pull request overview
Fixes a post-signup / post-navigation redirect loop by making client-side redirects idempotent (no-op when already on the target route) and by ensuring client auth/workspace state stays consistent with newer server-provided user data.
Changes:
- Prevent infinite same-URL redirects by ignoring
redirectTovalues that match the current route. - Ensure users with access but incomplete signup are redirected to
/signupvia an effect (instead of during render). - Keep client auth user subgraph in sync with newer server-provided user data and reset invalid workspace selections to a default.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| apps/hash-frontend/src/pages/shared/workspace-context.tsx | Derives activeWorkspace explicitly and resets invalid activeWorkspaceWebId to a default workspace. |
| apps/hash-frontend/src/pages/shared/auth-info-context.tsx | Adopts newer server-provided authenticated-user subgraph based on transaction time comparisons. |
| apps/hash-frontend/src/pages/index.page.tsx | Redirects incomplete-signup users to /signup using useEffect to avoid render-time navigation. |
| apps/hash-frontend/src/pages/_app.page.tsx | Avoids same-path redirectTo handling to prevent replace -> getInitialProps -> replace loops and avoids stalling UI when the redirect is a no-op. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
🌟 What is the purpose of this PR?
Fixes an issue where the user could get stuck in a loop post-signup.
Pre-Merge Checklist 🚀
🚢 Has this modified a publishable library?
This PR:
📜 Does this require a change to the docs?
The changes in this PR:
🕸️ Does this require a change to the Turbo Graph?
The changes in this PR: