Skip to content

Stop treating an Auth outage as a successful local save - #171

Merged
Programcode merged 2 commits into
mainfrom
cursor/save-needs-real-session-791b
Oct 22, 2026
Merged

Programcode merged 2 commits into
mainfrom
cursor/save-needs-real-session-791b

Conversation

@Programcode

Copy link
Copy Markdown
Owner

A failed call to the Auth server was treated as "signed out." Saves then wrote only in this browser and the page still looked successful, so the work never reached the database.

I found this by re-reading the October security notes against current main and tracing getUser() in the session, settings, debate, and sparring stores. There are no open GitHub issues. A 503 from /auth/v1/user used to skip the server write.

The stores now use the user id the app already has, then the local session, when the Auth server does not answer. A write with no user id throws instead of pretending it saved. If adding a library source fails, the library shows a toast: "Could not save this source." (Spanish and Hungarian catalogs have the same key).

UI change for the preview: that new failure toast on the library page. Nothing else on the page layout changed.

Verified locally (GitHub Actions is out of minutes, so this is not a CI pass):

  • npx vitest run on the new session-save test plus settings migration, debate context, and debate gates (43 passed)
  • npx eslint on the touched files
  • npm run typecheck
  • npm run docs:check

Not run: npm run verify (the e2e smoke suite) and a click-through in the browser.

Open in Web Open in Cursor 

Signed-in writes asked the Auth server who the user was. When that call failed, the app stored the source only in the browser and showed success. The id already in the session is enough, and a missing user now fails the save instead of hiding it.

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:34pm UTC
debatelab-staging Ready Ready Preview Oct 22, 2026 12:34pm UTC

@coderabbitai

coderabbitai Bot commented Oct 22, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • 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:26
Copilot AI balanced review requested due to automatic review settings October 22, 2026 12:26

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 — 50f5deb4 Deployed Oct 22, 2026 by vercel[bot]
Preview – debate-navigator — 50f5deb4 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