Debug delta diffing: add diagnostics + empty-delta fallback
- All game action handlers: move ToDto() call to after SaveStateAsync() so the ACK's StateVersion matches the pushed delta (stale-version fix) - GameHandlerBase.PushStateToPlayersAsync: add empty-delta safety fallback — when ComputeDelta() returns all-null content fields, fall back to a full game.state_update push so clients always see the correct state - Add Console.WriteLine diagnostics to PushStateToPlayersAsync to expose prev/next phase, turn, active player, and whether prevStateJson matches the post-mutation session.StateJson (root cause investigation) - Game.gd: wire game.activity push to game_activity signal 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>
This commit is contained in:
@@ -60,10 +60,10 @@ internal sealed class GameConcedeHandler : GameHandlerBase, IMessageHandler
|
||||
session.WinCondition = "concede";
|
||||
session.EndedAt = DateTimeOffset.UtcNow;
|
||||
|
||||
var dto = GameEngine.ToDto(newState, actorId);
|
||||
await SaveStateAsync(_gameDb, session, newState, actorId, "game.concede",
|
||||
JsonSerializer.Serialize(req), ct, JsonSerializer.Serialize(dto));
|
||||
JsonSerializer.Serialize(req), ct);
|
||||
|
||||
var dto = GameEngine.ToDto(newState, actorId);
|
||||
await FinalizeGameAsync(
|
||||
_gameDb, _identityDb, _clientPush, _eventBus,
|
||||
session,
|
||||
|
||||
Reference in New Issue
Block a user