From 1db6b2596e1dbe11f7926c32bbce1ded3ef21f27 Mon Sep 17 00:00:00 2001 From: Ryan Hamamura <58859899+ryanhamamura@users.noreply.github.com> Date: Tue, 3 Mar 2026 08:49:35 -1000 Subject: [PATCH] fix: disable SSE request cancellation for live game updates The default Datastar requestCancellation:'auto' was causing SSE connections to be cancelled whenever users interacted with the page (making moves, sending chat messages, etc.), breaking live updates. --- features/c4game/pages/game.templ | 5 +++-- features/snakegame/pages/game.templ | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/features/c4game/pages/game.templ b/features/c4game/pages/game.templ index c175b42..c5d9f11 100644 --- a/features/c4game/pages/game.templ +++ b/features/c4game/pages/game.templ @@ -1,13 +1,14 @@ package pages import ( + "fmt" + "github.com/ryanhamamura/games/chat" chatcomponents "github.com/ryanhamamura/games/chat/components" "github.com/ryanhamamura/games/connect4" "github.com/ryanhamamura/games/features/c4game/components" sharedcomponents "github.com/ryanhamamura/games/features/common/components" "github.com/ryanhamamura/games/features/common/layouts" - "github.com/starfederation/datastar-go/datastar" ) templ GamePage(g *connect4.Game, myColor int, messages []chat.Message, chatCfg chatcomponents.Config) { @@ -15,7 +16,7 @@ templ GamePage(g *connect4.Game, myColor int, messages []chat.Message, chatCfg c
@GameContent(g, myColor, messages, chatCfg)
diff --git a/features/snakegame/pages/game.templ b/features/snakegame/pages/game.templ index c7cc9c4..378690c 100644 --- a/features/snakegame/pages/game.templ +++ b/features/snakegame/pages/game.templ @@ -33,7 +33,7 @@ templ GamePage(sg *snake.SnakeGame, mySlot int, messages []chat.Message, chatCfg