Repository navigation
fix: a 429 or 5xx on the session check shows the error page instead of signing the user out - #420
Merged
Merged
Conversation
…f signing the user out
HardMax71
enabled auto-merge (squash)
October 19, 2026 22:17
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
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. Comment |
|
|
Codecov Report✅ All modified and coverable lines are covered by tests.
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
Small bug found while chasing a flaky E2E test. The root layout's load treats any failed
/api/v1/auth/meas "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/mewith 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
Test Plan
cd backend && uv run pytest tests/unit)cd frontend && npm run test)docker compose exec -T backend sh -c 'uv sync --group test --no-dev --frozen --no-install-project --no-build && pytest tests/e2e')cd frontend && npm run test:e2e)./deploy.sh openapi, then./deploy.sh types), never edited by handValidation: lint, svelte-check, format:check and the coverage run (870 tests) pass, with two new cases for a 429 and a 500.
Checklist
pre-commit run --all-filesand all checks passSummary 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/merequest 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.Written for commit 0c1bef8. Summary will update on new commits.