feat: persist chat messages to SQLite #1

Merged
ryan merged 1 commits from feat/chat-history-persistence into main 2026-02-13 22:00:01 +00:00
Owner

Summary

  • Add chat_messages SQLite table with migration, storing game ID, nickname, color, message text, and timestamp
  • Load last 50 messages on connect so players see history after refresh or late join
  • Save each sent message to the database before publishing via PubSub

Test plan

  • Create a game, send chat messages, refresh the page — messages persist
  • Open game in a second browser — existing chat history is visible
  • Verify real-time delivery still works (messages appear instantly for both players)
  • Verify the 50-message cap works correctly
## Summary - Add `chat_messages` SQLite table with migration, storing game ID, nickname, color, message text, and timestamp - Load last 50 messages on connect so players see history after refresh or late join - Save each sent message to the database before publishing via PubSub ## Test plan - [ ] Create a game, send chat messages, refresh the page — messages persist - [ ] Open game in a second browser — existing chat history is visible - [ ] Verify real-time delivery still works (messages appear instantly for both players) - [ ] Verify the 50-message cap works correctly
ryan added 1 commit 2026-02-13 21:59:20 +00:00
Chat messages were ephemeral — lost on page refresh or late join.
Add a chat_messages table and load the last 50 messages on connect
so players see conversation history.
ryan merged commit 3593197271 into main 2026-02-13 22:00:01 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: ryan/games#1