Skip to content

Stop the next account on a shared browser from seeing the previous person's drafts - #158

Merged
Programcode merged 2 commits into
mainfrom
cursor/bind-local-account-f3c6
Oct 22, 2026
Merged

Programcode merged 2 commits into
mainfrom
cursor/bind-local-account-f3c6

Conversation

@Programcode

Copy link
Copy Markdown
Owner

A sign-in that reloads the page (magic link or Google) never ran the in-tab account switch. The previous person's Ask thread, case and tool drafts, custom prompt, and current debate stayed in this browser and showed up for the next account.

Sign-in now records which account that local snapshot belongs to and clears it when the account is different, before the app unlocks. A reload that finishes late cannot put the other account's snapshot back, and another tab cannot apply it either.

Saved history still loads from the server. Device-only drafts saved before this change have no account on them, so the first sign-in after the update clears those too.

Verified locally with npx eslint on the touched files, tsc --noEmit -p tsconfig.app.json, and npm test (309 passed). One unrelated backend-status test timed out in mkdtemp on this machine; it does not touch this change. GitHub Actions is not running because of the repo billing limit, so this is a local pass, not a CI pass.

Open in Web Open in Cursor 

A full-page sign-in never ran the in-tab account switch, so the next person on the same browser could see the previous account's Ask thread, case drafts, custom prompt, and current debate. Sign-in now clears that local snapshot when it belongs to someone else, and a late reload cannot put it back.

Co-authored-by: Gáborjáni-Szabó Ádám <Programcode@users.noreply.github.com>
@vercel

vercel Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
debate-navigator Ready Ready Preview Oct 22, 2026 12:33pm UTC
debatelab-staging Ready Ready Preview Oct 22, 2026 12:33pm UTC

@coderabbitai

coderabbitai Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

Next included review available in 50 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
📥 Commits

Reviewing files that changed from the base of the PR and between 4f9e0a0 and d141363.

📒 Files selected for processing: 7
  • src/hooks/use-session-storage-sync.ts
  • src/lib/stores/debate-store.ts
  • src/lib/stores/session-store.ts
  • src/lib/stores/settings-store.ts
  • src/lib/supabase/AuthProvider.tsx
  • src/test/auth/AuthProvider.behavior.test.tsx
  • src/test/stores/account-local-state.test.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Note

🎁 Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Essentials by visiting https://app.coderabbit.ai/settings/billing.

Comment @coderabbitai help to get the list of available commands.

# Conflicts:
#	src/lib/stores/session-store.ts
@Programcode
Programcode marked this pull request as ready for review October 22, 2026 12:25
Copilot AI balanced review requested due to automatic review settings October 22, 2026 12:25

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

This branch was successfully deployed

2 active deployments
Preview – debatelab-staging — 0901f93c Deployed Oct 22, 2026 by vercel[bot]
Preview – debate-navigator — 0901f93c Deployed Oct 22, 2026 by vercel[bot]
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.

3 participants