frontend bug hunt fixes + stream-ticket auth#259
Merged
Conversation
release 1.0.1
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
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.
Multi-agent frontend bug hunt followed by fixes. Findings report lives in the gitignored FRONTEND-BUGS.md (48 confirmed, 13 disputed, 40 rejected; no confirmed criticals).
What changed
Bug fixes (60 confirmed/disputed findings across 43 frontend files)
response.json()in error branches so non-JSON bodies (proxy 502/HTML, empty 204) no longer mask the real HTTP error (auth, admin, exceptions clients).Single-use stream tickets (closes the 3 high "token in URL" findings)
WebSocket/EventSource cannot send an Authorization header, so the session token used to be placed in the stream URL query string (logged by proxies). Now:
049_stream_tickets.sql(ticket stored in the relational DB, not Redis, to stay portable across BullMQ/graphile).POST /api/v1/stream-ticketsmints a short-lived, single-use ticket for the authenticated user.?ticket=and consume it once. Legacy?token=still works for backward compat.Global 401 handler
A single fetch interceptor installed at app startup clears auth and redirects to /login (preserving the current path) on any authenticated
/api/v1401 that is not an auth endpoint. Avoids refactoring all 32 API clients.Tests
stream-tickets.test.ts: 8 tests covering the service (single-use, expiry) and the end-to-end ticket auth chain.svelte-check: no new errors (only the pre-existing baseline). Backendtsc --noEmit: clean.Not done (intentional)
Note: this branch was cut from main, so it also carries a few main-only commits (release 1.0.1, dependency bumps, clickhouse backfill) that are not yet on develop.