Repository navigation
fix(gateway): keep players connected when a move's session retires before activation - #340
Merged
Merged
Conversation
oglassdev
force-pushed
the
fix/move-into-retiring-session
branch
from
October 12, 2026 23:54
4823828 to
2fe795a
Compare
…fore activation Control refuses to claim a reservation whose session retired, so a move still preparing fails as a move and its player stays active on the source. Activation of a claim whose session retired first is reported as a distinct outcome instead of a stale activation; the gateway then withdraws the claim, records the move as failed and routes the player as a login on the same connection, since the move already fenced its source. A stale generation or a claim withdrawn while its session runs is still rejected. Fixes #292
…m or configuration Record on a claim that its session retired, so activation reports retirement only for claims it ended and not for cancelled, abandoned or superseded ones. A login whose session retires while claiming is refused with a new claim refusal and claimed again under a new operation ID. A move whose claim ends before configuration is abandoned, and one whose destination retires during configuration is routed again as a login.
…led, not by when a claim ended
…one report, in a roster, mid-claim and mid-configuration
oglassdev
force-pushed
the
fix/move-into-retiring-session
branch
from
October 13, 2026 00:16
2fe795a to
ea452f0
Compare
…nd read it after the report commits
2 tasks
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.
Fixes #292. When a player was moved into a session at the moment it retired through
scope.finish(), control failed the activation withstale activationand the gateway disconnected the player. Players now keep their connection.What the player sees
The issue asked for the player to stay on their source session. That is not reachable in the second case: by the time activation runs, the move has already released the source claim and the client has left play state for configuration. Returning them to the source would need the JVM to take a player back after configuration, or activation before the source is fenced. This PR does not attempt either.
How
DESTINATION_RETIRED, when claiming and when activating. A claim is lost to retirement when it never admitted its player, control did not cancel it while its session still ran, and its session is retired now. That is read from the session when asked, so it does not depend on the order a JVM report's deliveries and sessions are applied in. The only new state isClaim.canceled, set where control itself begins a withdrawal.ActivateResultgainsretiredandClaimRefusalgainsDESTINATION_RETIRED, so the gateway does not match on error strings.Worth a reviewer's attention
PlayerLoginand route hooks run again under a new membership, and noPlayerDisconnectfires for the old one.examples/arenastill resets an emptied arena instead of finishing it. Reverting that is a behaviour change to the example, left for later.Tests
serveloop with a client and a fake JVM: a move whose destination retires during configuration keeps the player connected on a new login.Checks
cargo test -p chunk-control(91 passed),cargo test -p chunk-proxy(84 passed),cargo test -p chunk-environment --lib(193 passed, 2 ignored, run before the last two commits),cargo clippy --all-targets --all-features -D warningsandcargo fmt --checkon the touched crates,buf lintandbuf format.🤖 Generated with Claude Code