Skip to content

Re-apply codec tracker after reconnect channel swap#10565

Merged
tool4ever merged 1 commit intoCard-Forge:masterfrom
MostCromulent:fix-reconnect-codec-tracker
Apr 29, 2026
Merged

Re-apply codec tracker after reconnect channel swap#10565
tool4ever merged 1 commit intoCard-Forge:masterfrom
MostCromulent:fix-reconnect-codec-tracker

Conversation

@MostCromulent
Copy link
Copy Markdown
Contributor

Fixes #10562.

Cause

PR #10343 (Apr 24) added a per-channel codec Tracker to the encoder/decoder pipeline so client→server protocol args can travel as IdRef markers. PR #9708 (Feb 12) had earlier introduced RemoteClient.swapChannel for the reconnect handshake. The two never met: swapChannel replaces the underlying channel but doesn't re-apply the tracker to the new pipeline.

After reconnect, the server-side decoder has no tracker, so IdRef markers in client→server messages never resolve back to CardView/PlayerView. Method.invoke then fails with IllegalArgumentException for every protocol method that takes a tracked argument (selectCard, selectPlayer, getAbilityToPlay, …). Argless methods (selectButtonOk, passPriority) keep working — matching the report of "can only click OK or End Turn" after reconnect.

Fix

Cache the tracker on RemoteClient so swapChannel can re-apply it to the new pipeline.


🤖 Generated with Claude Code

When RemoteClient.swapChannel replaces the channel for a reconnecting
client, the new channel's pipeline starts with no Tracker on its
encoder/decoder. Without it, IdRef markers in client→server messages
never resolve back to CardView/PlayerView, and Method.invoke fails
with IllegalArgumentException for every protocol method that takes a
tracked argument (selectCard, selectPlayer, getAbilityToPlay, ...).
Argless methods (selectButtonOk, passPriority) keep working — matching
the <!-- -->Card-Forge#10562 report of "can only click OK or End Turn" after reconnect.

Cache the tracker on RemoteClient so swapChannel can re-apply it to
the new pipeline.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@tool4ever tool4ever merged commit ef6a2f2 into Card-Forge:master Apr 29, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Clients unable to interact after reconnect

2 participants