fix: close 22 pre-demo bugs across auth, locks, races, and UX #1
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
1st-Chertsey-Scout-Group/bingo!1
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "features/pre-demo-improvements"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
22 bugs diagnosed in
docs/bugs/and fixed one commit each, grouped by cluster fromdocs/bugs/README.md.Auth (4). New
src/lib/session-token.tsprimitive (32-byte random token, sha-256 hashed,timingSafeEqualcompare) +Team.sessionTokenHashcolumn. Scoutlobby:join/rejoinbound to the token;/api/uploadgated on it;contentTypewhitelisted toimage/webp;photoUrlvalidated against the app S3 prefix.Round state (2).
Game.roundnow bumps ongame:newround, notgame:start, soTeam.round === Game.roundduring active play. Scout rejoin tolerates one round of lag.Transactions (3).
src/lib/game-mutex.tsper-game mutex +@@unique([gameId, round, name])on Team.submission:submit,review:approve, andgame:starteach run as a single Prisma transaction.Locks (4).
review:approve/review:rejectrequirelockedByLeader === leaderName. Lock-timeout map keyed on${gameId}:${leaderName}. Startup sweep inregisterSocketHandlersclears stale DB locks.Silent failures (3). Client subscribes to server
'error'and toasts.rejoin:errortriaged into fatal / recoverable / advisory. 0–500 ms jitter on scout rejoin aftergame:lobby.Remaining (6). Duplicate pending rejected;
game:startrequires ≥2 teams;generateBoardbackfills short template runs; socket reads game/team fromsocket.data, leaves prior rooms on join;pickRandomUnusedTeam;PendingUploadsweep onendGame.Test plan
npm run test— 51 passing (13 new: session-token, game-mutex, teams, game-logic)npx tsc --noEmitcleanPendingUploadrow + S3 object are sweptNotes
docs/bugs/*.mdkept as-is (immutable diagnoses).dist/+ React-Compiler warnings; no new findings.