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 cloud conflict branch plus conflict details so the game can reconcile intentionally.

Conflict Example

Use this pattern for explicit conflict recovery.

JAVASCRIPT
const SYNC_STATUS_ACCEPTED := "accepted"
const SYNC_STATUS_CONFLICT := "conflict"
const CONFLICT_REASON_BASE_VERSION_MISMATCH := "base_version_mismatch"

var result := client.sync_account_slot(account_id, account_session_token, slot_id, {
  "baseVersion": local_save["version"],
  "slotInfo": local_save["slotInfo"],
  "data": next_data
})

if result.get("status") == SYNC_STATUS_ACCEPTED:
  local_save = result["slot"]

if result.get("status") == SYNC_STATUS_CONFLICT:
  var cloud_slot := result["slot"]

  var details := result.get("details", {})
  if details.get("reason") == CONFLICT_REASON_BASE_VERSION_MISMATCH:
    # Keep cloud_slot as the baseline. If the player keeps local edits,
    # retry with baseVersion = cloud_slot["version"] and the local draft data.
    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.slot is the cloud conflict branch and should become the baseline before retrying local edits.

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 cloud slot version instead of resubmitting the stale payload blindly.