{
  "id": 11107469,
  "title": "Local-first saves and deciding which copy of the truth wins",
  "url": "https://urgent.news/2026/10/01/local-first-saves-and-deciding-which-copy-of-the-truth-wins",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-10-01T04:30:09.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/idlecultivation/local-first-saves-and-deciding-which-copy-of-the-truth-wins-2aoa"
  },
  "original_language": "en",
  "account": "Between 2 August 2026 and 4 August 2026, a team worked on an idle game that must function on a player's device due to its continuous ticking. The game features an economy, requiring an authoritative record that cannot be argued with by the game. The project settled on the rule that reconciliation only runs in one direction, with the authoritative record deciding the final state while the local state mirrors it and can run ahead optimistically between syncs. However, this approach has a significant consequence: any local gains that do not reach the record are lost at the next sync. The temptation to grant the local side more freedom often leads to the mirror becoming a second source of truth, undermining the system's guarantee of a player's actual ownership. Three common faults were observed during this period: missing materials during gathering, crafting output without spending ingredients, and rewards accepted but dropped due to bag capacity limitations. These issues all stem from granting things locally without propagating the change through the path that makes them real. A ranking board also experienced a glitch, placing all players at the bottom due to a missing field in the payload. Lastly, a race condition caused a save operation to fail intermittently when debounced, as a separate routine attempted to set up a particular state before reloading, causing the reload to revert to the old state. The key takeaway is that the set of fields being sent in the payload is a design artifact and requires maintenance to ensure consistency. Additionally, derived and presentational data should not be included in scheduled saves to keep the payload size manageable.",
  "summary": "Development covered 2 Aug 2026 to 4 Aug 2026 (commit dates). An idle game has to run on the player's device. The loop ticks while they are looking at it, keeps ticking while they are not, and cannot wait for a network round for every increment. It also has an economy, which means somewhere there is an authoritative record that the game does not get to argue with. That combination gives every…",
  "key_points": [
    "Game requires authoritative record on player's device",
    "Local state can run ahead, but risks losing gains",
    "Design artifact: payload fields need maintenance"
  ],
  "editors_take": "The game's design choice to prioritize the authoritative record over local state means that players may lose progress if their local gains aren't synced, undermining the system's ownership guarantees.",
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}