Skip to content

feat(frontend): sync player colour, ply tracking and offline move queue - #1445

Merged
chinweobtagaz merged 1 commit into
OpenKnight-Foundation:mainfrom
limxiy:feature/game-color-sync-and-offline-queue
Oct 18, 2026
Merged

chinweobtagaz merged 1 commit into
OpenKnight-Foundation:mainfrom
limxiy:feature/game-color-sync-and-offline-queue

Conversation

@limxiy

@limxiy limxiy commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

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.

Tests

  • frontend/__tests__/chessSocketSync.test.ts

Closes #1354
Closes #1355
Closes #1356
Closes #1347

…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
@drips-wave

drips-wave Bot commented Oct 17, 2026

Copy link
Copy Markdown

@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! 🚀

Learn more about application limits

@chinweobtagaz
chinweobtagaz merged commit 064251e into OpenKnight-Foundation:main Oct 18, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment