BGS undoes the only human's last saved move by calling replay(data, { to })
with the log length recorded before that move, and requires
logLength(result) === to. The wrapper passed `to` to the internal replay as
a history index, so most undo requests failed or landed elsewhere; admin
replays, which also send log positions, had the same problem.
With a position, replay now rewinds to the first point where the journal
reaches it, then reapplies later name changes and drops, and does not queue
chat announcements of replayed moves again. Choices that add no journal
entry (live route and readiness edits, preparation before the last player is
ready) are not restored: undoing one reopens them for every player, and the
bots choose again. replay(data) without a position, createAnalysis and the
internal history-index replay are unchanged.
Tests play complete 2-4 player games against bots: every undo point reaches
its log length and deep-equals the saved state unless unannounced choices
preceded the move; otherwise the reopened phase stays playable.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
BGS lets the only human of a game against bots take back their last saved
move (protocol 0.10.0). The header utilities show an undo control while BGS
reports it available to the seated player, except in analysis and while a
move awaits the next state; it asks BGS to undo, which then sends the
earlier state. A state that goes backwards stops playback and discards local
selections (dice, equipment forms, lava warnings). The local harness offers
the same control after each move made from the interface.
Upgrade @boardgamers/protocol from 0.6.1 to 0.10.0 (older versions drop
undo:available) and remove the 0.6.1 chat scrolling patch: 0.10.0 ships the
same fix.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>