fix(multiplayer): recover stale proposal mutations

This commit is contained in:
Josh Creek
2026-09-01 15:31:01 +01:00
parent 04b5d3b29d
commit dad26a164c
3 changed files with 7 additions and 7 deletions
+4
View File
@@ -308,6 +308,7 @@ func _on_request_completed(result: HTTPRequest.Result, response_code: int, _head
return
if response_code < 200 or response_code >= 300:
var detail := String(parsed.get("error", "request rejected"))
var recover_proposal_after_conflict := response_code == HTTPClient.RESPONSE_CONFLICT and (operation == "proposal_accept" or operation == "proposal_decline") and not state.proposal_id.is_empty()
if response_code == HTTPClient.RESPONSE_UNAUTHORIZED:
access_token = ""
auth_expired = true
@@ -328,6 +329,9 @@ func _on_request_completed(result: HTTPRequest.Result, response_code: int, _head
else:
state.set_notice(detail)
request_failed.emit(operation, response_code, detail)
if recover_proposal_after_conflict:
_pending_resync_resource_id = state.proposal_id
call_deferred("_run_pending_resync")
return
var payload: Dictionary = parsed
if operation == "steam_session":