Repository navigation
feat(frontend): sync player colour, ply tracking and offline move queue - #1445
Merged
chinweobtagaz merged 1 commit intoOct 18, 2026
Conversation
…equence offline moves - PlayGameEngine no longer hardcodes playerColor="white": the colour is passed through from matchmaking (?color=), orients the board and gates legal moves to that side (FE-115 / OpenKnight-Foundation#1356) - useChessSocket now surfaces the server's authoritative `sync` reply as `lastSyncedState`, and PlayGameEngine resets its position, move history and clocks from it so opponent moves missed while disconnected are applied (FE-113 / OpenKnight-Foundation#1354) - Offline move queue: every outgoing move carries its ply index, the hook handles server `ack` messages, requests `sync` before flushing on reconnect and drops queued moves the server already applied (FE-114 / OpenKnight-Foundation#1355) - Add __tests__/chessSocketSync.test.ts covering sync restore, ply stamping and ack-based queue reconciliation Closes OpenKnight-Foundation#1354 Closes OpenKnight-Foundation#1355 Closes OpenKnight-Foundation#1356
|
@limxiy Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the play page ignoring the assigned colour, losing the server sync
state after a reconnect, and replaying queued offline moves without ply/ack
information.
PlayGameEnginenow accepts aplayerColorprop and derivesboardOrientationfrom it (FE-115:PlayGameEngineHardcodesplayerColor = "white"for Both Players #1356)?color=and passes the colour through (FE-115:PlayGameEngineHardcodesplayerColor = "white"for Both Players #1356)plyand only replayed once the serveracknowledges prior moves (FE-114: Offline Move Queue Replays Moves With No Ply Number or Acknowledgement #1355)
syncreply the server sends after a reconnect is applied as theauthoritative game state (FE-113: Board Is Not Restored After Reconnect — the Server's
syncReply Is Ignored #1354)chessSocketSynctest covering ack/sync orderingTests
frontend/__tests__/chessSocketSync.test.tsCloses #1354
Closes #1355
Closes #1356
Closes #1347