Skip to content

fix: a 429 or 5xx on the session check shows the error page instead of signing the user out - #420

Merged
HardMax71 merged 1 commit into
mainfrom
fix/auth-me-429-not-signed-out
Oct 19, 2026
Merged

HardMax71 merged 1 commit into
mainfrom
fix/auth-me-429-not-signed-out

Conversation

@HardMax71

@HardMax71 HardMax71 commented Oct 19, 2026 •

Copy link
Copy Markdown
Owner

Summary

Small bug found while chasing a flaky E2E test. The root layout's load treats any failed /api/v1/auth/me as "nobody is signed in" (+layout.ts), so a 429 from the rate limiter or a 5xx sends a signed-in user to the login page. A local Playwright run on 4 workers shows it: the backend answered /auth/me with 429 76 times, and 10 admin tests landed on "Sign in to your account" with valid sessions.

Changes

Only a 401 or no answer at all still means no user. Any other error throws SvelteKit's error(status, detail), so the error page shows it and the session stays.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Refactoring (no functional changes)
  • CI/CD or tooling changes

Test Plan

  • Backend unit tests pass (cd backend && uv run pytest tests/unit)
  • Frontend unit tests pass (cd frontend && npm run test)
  • Backend E2E tests pass (docker compose exec -T backend sh -c 'uv sync --group test --no-dev --frozen --no-install-project --no-build && pytest tests/e2e')
  • Frontend E2E tests pass (cd frontend && npm run test:e2e)
  • API spec and client regenerated if routes or schemas changed (./deploy.sh openapi, then ./deploy.sh types), never edited by hand
  • Manual testing performed

Validation: lint, svelte-check, format:check and the coverage run (870 tests) pass, with two new cases for a 429 and a 500.

Checklist

  • My code follows the project's style guidelines
  • I have run pre-commit run --all-files and all checks pass
  • I have added tests that prove my fix/feature works
  • I have updated documentation if needed
  • My changes don't introduce new warnings

Summary by cubic

Fixes the session check so a 429 rate limit or 5xx response shows the error page instead of signing an authenticated user out.

Previously, any failed /api/v1/auth/me request was treated as "nobody is signed in", so transient backend errors sent users to the login page. Now only a 401 or no answer at all means no user; other failures throw a SvelteKit error and keep the session.

  • Adds test cases covering a 429 and a 500 response.

Written for commit 0c1bef8. Summary will update on new commits.

View guided diff Turn on auto-fix

@HardMax71
HardMax71 enabled auto-merge (squash) October 19, 2026 22:17
@coderabbitai

coderabbitai Bot commented Oct 19, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d38412d2-65b6-4de5-a653-9310661d1105
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@github-actions github-actions Bot added the area: frontend Svelte UI and the generated API client label Oct 19, 2026
@sonarqubecloud

Copy link
Copy Markdown

@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Flag Coverage Δ
frontend-unit 92.61% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
frontend/src/routes/+layout.ts 100.00% <100.00%> (ø)
Components Coverage Δ
Backend 92.46% <ø> (ø)
Frontend 92.61% <100.00%> (+<0.01%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@HardMax71
HardMax71 merged commit 89dc7d8 into main Oct 19, 2026
21 checks passed
@HardMax71
HardMax71 deleted the fix/auth-me-429-not-signed-out branch October 19, 2026 22:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: frontend Svelte UI and the generated API client

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants