From 557b238e88189e1314c39af82d77c94ba9dbd19e Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 15 Feb 2026 11:32:38 +0900 Subject: fix(backend): resolve TODO items for transactions, validation, and error 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 --- backend/api/handler_wrapper.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'backend/api/handler_wrapper.go') diff --git a/backend/api/handler_wrapper.go b/backend/api/handler_wrapper.go index 8e3e8cd..7448d13 100644 --- a/backend/api/handler_wrapper.go +++ b/backend/api/handler_wrapper.go @@ -5,6 +5,8 @@ package api import ( "context" + "github.com/jackc/pgx/v5/pgxpool" + "albatross-2026-backend/config" "albatross-2026-backend/db" ) @@ -15,10 +17,11 @@ type HandlerWrapper struct { impl Handler } -func NewHandler(queries *db.Queries, hub GameHubInterface, conf *config.Config) *HandlerWrapper { +func NewHandler(queries *db.Queries, pool *pgxpool.Pool, hub GameHubInterface, conf *config.Config) *HandlerWrapper { return &HandlerWrapper{ impl: Handler{ q: queries, + pool: pool, hub: hub, conf: conf, }, -- cgit v1.3.1