Godot Conflict Handling

Treat conflict handling as a normal part of the Godot save flow.

A stale baseVersion is not a transport failure. The Godot SDK returns the canonical server save plus conflict details so the game can reconcile intentionally.

Conflict Example

Use this pattern for explicit conflict recovery.

var result := client.sync_save(save_id, {
  "baseVersion": local_save["version"],
  "metadata": local_save["metadata"],
  "state": next_state
})

if result.get("status") == "accepted":
  local_save = result["save"]

if result.get("status") == "conflict":
  local_save = result["save"]

  var details := result.get("details", {})
  if details.get("reason") == "base_version_mismatch":
    # Decide whether to reapply unsynced local edits or prompt the player.
    pass

Rules

These are the conflict semantics the Godot integration depends on.

The Godot SDK keeps 409 as an explicit conflict status instead of flattening it into a generic error result.

result.save is the canonical server save and should replace your local canonical snapshot first.

details.reason is currently base_version_mismatch for stale sync attempts.

If you want to retry with local edits, build a fresh sync request from the new canonical version instead of resubmitting the stale payload blindly.