Transfer debounce and spectator listener#31
Merged
Conversation
… feed)
SessionLiveFeed opens a dedicated spectator WsClient (?spectate=true) and
renders a read-only event feed in a new SessionView 'live' tab for DM/admin.
WsClient.connect gains a { playerId?, spectate? } options form. Broke the
latent wsClient<->gameStore import cycle (surfaced by importing WsClient from
a component): wsClient now reads identity via loadIdentity() from identitySlice
(type-only gameStore import) instead of useGameStore.getState().
…vict The grace-period debounce deferred BOTH stop_round and eviction. Deferring stop_round left a player-less round loop advancing NPC turns during the grace window: for a real player a network blip silently costs combat turns, and because every session draws from one process-global dice RNG, overlapping orphaned rounds shifted the RNG nondeterministically. That is what flaked test_player_state_xp::test_rest_status_updated_after_kill in CI (1 failed / 159 passed): at the failure moment several arena/OA sessions whose sockets had already closed were still ticking combat (visible as consecutive_failures_end_turn in the backend log), draining the shared seeded RNG so the combat_test player's attacks no longer killed the 1-HP dummy within the message budget, and no xp_gained event was observed. Fix: on the last player leaving, stop the round at once (restoring pre-PR behavior) and defer only the registry eviction via the grace timer. A reconnect inside the window cancels the eviction and restarts the round through the player WS path's idempotent start_round. This is a code fix, not a test change: the behavior (round advancing with nobody connected) was the regression. Also: BACKLOG vitest-load-flakes -> [x] mitigated (fileParallelism:false, already in this PR; note the proper long fix is per-file isolation, not whole-run serialization). Three consecutive make test-integration runs green (160 passed, ~11.5s each); make check-backend green (2381 passed).
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:
Verification:
Notes: