Compare commits

..

2 Commits

Author SHA1 Message Date
semantic-release-bot
a57ebdf142 chore(release): 3.14.3 [skip ci]
## [3.14.3](https://github.com/antialias/soroban-abacus-flashcards/compare/v3.14.2...v3.14.3) (2025-10-15)

### Bug Fixes

* **arcade:** delete old session when room game changes ([98a3a25](98a3a2573d))
2025-10-15 00:17:53 +00:00
Thomas Hallock
98a3a2573d fix(arcade): delete old session when room game changes
When changing a room's game via the settings API, the old arcade
session was persisting with the previous game's state. This caused
users to still see the old game after selecting a new one.

Changes:
- Delete existing arcade session when gameName is updated in room settings
- Add debug logging to room page game selection handler
- Ensure fresh session is created with new game settings

This fixes the issue where clicking Memory Lightning would not
properly switch the game from Battle Arena.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-14 19:17:02 -05:00
4 changed files with 34 additions and 1 deletions

View File

@@ -1,3 +1,10 @@
## [3.14.3](https://github.com/antialias/soroban-abacus-flashcards/compare/v3.14.2...v3.14.3) (2025-10-15)
### Bug Fixes
* **arcade:** delete old session when room game changes ([98a3a25](https://github.com/antialias/soroban-abacus-flashcards/commit/98a3a2573db51899c41ba02796895d676c4e16ef))
## [3.14.2](https://github.com/antialias/soroban-abacus-flashcards/compare/v3.14.1...v3.14.2) (2025-10-15)

View File

@@ -97,6 +97,13 @@ export async function PATCH(req: NextRequest, context: RouteContext) {
updateData.gameConfig = body.gameConfig
}
// If game is being changed (or cleared), delete the existing arcade session
// This ensures a fresh session will be created with the new game settings
if (body.gameName !== undefined) {
console.log(`[Settings API] Deleting existing arcade session for room ${roomId}`)
await db.delete(schema.arcadeSessions).where(eq(schema.arcadeSessions.roomId, roomId))
}
// Update room settings
const [updatedRoom] = await db
.update(schema.arcadeRooms)

View File

@@ -87,13 +87,32 @@ export default function RoomPage() {
// Show game selection if no game is set
if (!roomData.gameName) {
const handleGameSelect = (gameType: GameType) => {
console.log('[RoomPage] handleGameSelect called with gameType:', gameType)
const gameConfig = GAMES_CONFIG[gameType]
console.log('[RoomPage] Game config:', {
name: gameConfig.name,
available: gameConfig.available,
})
if (gameConfig.available === false) {
console.log('[RoomPage] Game not available, blocking selection')
return // Don't allow selecting unavailable games
}
// Map GameType to internal game name
const internalGameName = GAME_TYPE_TO_NAME[gameType]
console.log('[RoomPage] Mapping:', {
gameType,
internalGameName,
mappingExists: !!internalGameName,
})
console.log('[RoomPage] Calling setRoomGame with:', {
roomId: roomData.id,
gameName: internalGameName,
gameConfig: {},
})
setRoomGame({
roomId: roomData.id,

View File

@@ -1,6 +1,6 @@
{
"name": "soroban-monorepo",
"version": "3.14.2",
"version": "3.14.3",
"private": true,
"description": "Beautiful Soroban Flashcard Generator - Monorepo",
"workspaces": [