fix(multiplayer): defer reconnect recovery during mutations

This commit is contained in:
Josh Creek
2026-09-01 21:53:07 +01:00
parent 47aa196b59
commit fa2c93ec06
3 changed files with 19 additions and 3 deletions
+7 -3
View File
@@ -466,10 +466,14 @@ func _set_websocket_status(status: String) -> void:
websocket_status_changed.emit(status)
if status == "CONNECTED":
if not state.ticket_id.is_empty() and state.phase not in [MatchmakingState.CANCELLED, MatchmakingState.EXPIRED, MatchmakingState.FAILED, MatchmakingState.LIVE]:
if not state.proposal_id.is_empty():
recover_proposal(state.proposal_id)
var resource_id := state.proposal_id if not state.proposal_id.is_empty() else state.ticket_id
if _operation.is_empty():
_run_resync(resource_id)
else:
recover_queue(state.ticket_id)
# A reconnect must not lose its authoritative recovery merely because
# the previous mutation has not acknowledged yet. The deferred path
# runs after that request completes and avoids an ERR_BUSY drop.
_pending_resync_resource_id = resource_id
func _idempotency_key(prefix: String) -> String: