fix(workspace): recover from stale sessions instead of blank loader after impersonation#5688
Conversation
…fter impersonation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview
Impersonation start (admin) and stop (banner) both Reviewed by Cursor Bugbot for commit 81e74ae. Configure here. |
Greptile SummaryThis PR improves workspace recovery after impersonation and stale sessions. The main changes are:
Confidence Score: 5/5The latest changes look safe to merge.
Important Files Changed
Reviews (3): Last reviewed commit: "fix(workspace): proceed with redirect wh..." | Re-trigger Greptile |
|
@cursor review |
…ached identity exists
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 81e74ae. Configure here.
Summary
/workspaceafter switching or stopping impersonation (or letting an impersonation session expire) — previously the page renderednullforever when the workspaces query failed, with no recovery other than clearing browser data/workspacenow auto-recovers from the stale-cookie state: a 401 while the session still claims we're authenticated triggers a full sign-out (clears all auth cookies server-side) and redirects to loginnull/login(middleware could bounce it straight back into a loop while the session cookie exists) — it shows the error card insteadclearUserData()before navigating, so one identity's persisted client state (localStorage / Zustand persisted stores) can't leak into the nextType of Change
Testing
Tested manually; tsc, biome, and check:api-validation pass
Checklist