| Age | Commit message (Collapse) | Author |
|
Previously GetWatchLatestStates returned ErrForbidden for participants
regardless of game state. Now checks whether the game has finished and
permits access once complete. Also fixes config test env var cleanup.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
|
DB stores stdin/code with CRLF intact, but workers expect LF. Add
normalizeCRLF helper and apply it to code and stdin in EnqueueTestTasks.
Refactor normalizeTestcaseResultOutput to reuse the same helper.
|
|
Admin users can now access the gaming UI (problem description, code
editor, submit button) even when a game has not started yet. Regular
users still see the waiting screen as before.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
|
Fix golangci-lint revive warnings by removing package name prefixes:
- game.GameHubInterface → game.HubInterface
- game.GameDetail → game.Detail
- tournament.TournamentEntry → tournament.Entry
- tournament.TournamentMatch → tournament.Match
- tournament.TournamentBracket → tournament.Bracket
- tournament.TournamentEditData → tournament.EditData
Also fix gofmt alignment in api/convert.go and gosimple S1016 in
game/service.go.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
|
Move transaction handling, rejudge workflow, tournament bracket creation,
and data repair logic from admin handler into game.Service and
tournament.Service, mirroring the earlier api package separation.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
|
Extract business logic from api/handler.go into dedicated service packages:
- session: context helpers (resolves admin → api import dependency)
- game: game state, code submission, ranking, watch logic
- tournament: bracket construction and seed ordering
- api/convert.go: domain → API type conversion functions
api/handler.go is now a thin adapter that delegates to services and
maps domain errors to HTTP status codes.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
|
Move regexp.MustCompile out of CalcCodeSize to avoid recompiling
on every call.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
|
account, and more handlers
Cover previously untested code: SessionCookieMiddleware, context helpers,
downloadFile, addAcceptHeader, doProcessTaskRunTestcase, updateSubmissionAndGameState,
PostLogout, GetGames, PostGamePlayCode, GetGameWatchRanking, GetGameWatchLatestStates.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
|
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
|
Cover previously untested logic: session ID generation/hashing,
password authentication, IP rate limiting, game state helpers,
handler endpoints, task enqueue/result processing, and config loading.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
|
Replace concrete *db.Queries and *pgxpool.Pool dependencies with
db.Querier and db.TxManager interfaces across all handlers, game hub,
and auth. This enables unit testing with mocks.
- Enable sqlc emit_interface to generate Querier interface
- Add TxManager abstraction to encapsulate transactions
- Convert auth package-level functions to Authenticator struct
- Add TaskQueueInterface/TaskWorkerInterface for game.Hub
- Add initial unit tests for game logic and API handlers
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
|
auth/auth.go: return error instead of panicking on data inconsistency.
game/hub.go: log unexpected task result types instead of panicking.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
|
handling
- Wrap multi-step DB operations in transactions (signup, submit, game
edit, task result processing)
- Add game running checks to PostGamePlayCode and PostGamePlaySubmit
- Hide ranking code when game is not yet finished
- Replace silenced errors in processTaskResults with slog.Error logging
- Add pgxpool.Pool to Handler/Hub structs for transaction support
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
|
Replace all usages of the standard log package with log/slog across
backend and swift worker. Configure Echo's request logger to emit
structured log attributes via slog instead of the default format.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
`golangci-lint`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
* processing incoming WebSocket messages
* processing task results
|
|
players
|
|
|
|
|