Files
sor/Server
7eeb3acbf0 fix: AI deck sync concurrency error and arch spirit placement trigger
AiDeckResolver (DbUpdateConcurrencyException on re-add):
- ReplaceRange via EF navigation property was failing when the same AI
  account's deck was synced more than once (retry after a failed lobby
  attempt left EF's change-tracked xmin stale).
- Fix: use ExecuteDeleteAsync to delete old DeckCard rows directly
  (bypasses change tracker), then AddRange new ones without touching
  the navigation property. Fully idempotent.

GamePlaceArchSpiritHandler (AI never places ArchSpirit):
- Previous fix checked newState.ActivePlayerAccountId, which stays as P1
  throughout the simultaneous placement phase — so AI opponents in seat 1
  (guest) were never triggered.
- Fix: when !bothPlaced, scan all players for AI accounts that haven't
  placed yet and publish AiTurnStartedEvent for each. When bothPlaced,
  keep the existing check for the first active player in Draw/Main phase.

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
2026-04-13 08:12:35 -04:00
..