Remote / Declared writes

Operation IDs and retries

Every Data.mutate mints a persistent operation ID (crypto.randomUUID() or 128-bit random ID) distinct from the per-session requestId. Retrying a failed write re-sends the exact input, now, and operation ID (validated on the server as up to 128 URL-safe characters):

ts
const started = Data.mutate(model, Sell, { id: 'p1', quantity: -2 })
const again = Data.retry(failedModel, started.requestId)

When a request fails with Unreachable (network drop or 502 gateway response), retrying via Data.retry is safe according to the retry guarantee table above.

Durable writes that outlive page reloads

Passing { durable: true } to Data.mutate(model, Sell, input, { durable: true }) with outbox(Data, ...) stores the write in KeyValueStore before sending, flushes queued writes in order across reloads with the same operation ID and timestamp, and partitions queues per principal. Pair durable writes with a ledgered writer on the server; entries arriving past clockSkew record server time (ClockSkewed). See Remote's outbox section.