Skip to content
AvailableUpdated 2026-11-28

Edit the same page together

See remote edits and cursors, and understand how concurrent patches are resolved.

Two editors can open the same page. Each saved patch streams to other open canvases, and a shared cursor shows where the other person is working.

What is shared

  • The document after each saved patch or restore, as a new version.
  • Presence: name, selected node and cursor position, refreshed by a heartbeat.
  • Comments stay page-scoped and are covered on their own page.

Concurrent edits

  1. 1Studio edits use a merge batch with a client-generated batch id and the version they started from.
  2. 2The server locks the page and applies the batch to the latest document, so different properties on the same node both survive.
  3. 3Text properties are merged character by character: edits made since the client's base version are replayed and non-overlapping characters survive.
  4. 4Each node and property keeps a version clock, and a deleted node keeps a tombstone so a stale update cannot resurrect it.
  5. 5Every inserted character has a stable id and a delete leaves a character tombstone; devices rebuild the same visible text from the server's character state.
  6. 6The batch id makes a retry after a lost response idempotent; an ambiguous overlapping replacement falls back to last-write-wins.

Offline edits

  • An edit made while the browser is offline is applied locally and queued in that browser's storage with its base version.
  • The Studio header shows how many edits are queued.
  • On reconnect the queue replays as merge batches with its original base version, so edits from another device still merge character by character.
  • Other devices see the result through the page event stream; a network failure after an edit is safe to retry because the batch is idempotent.

Character history

  • Select a text layer and open Text to see each accepted text edit.
  • Each entry shows the version, actor, inserted and deleted counts, and a before/after preview.
  • The panel also shows how many character cells and tombstones the layer has.

Peer sync

  • Automatic: start an automatic peer session on one device, give the code to the other device, and the two browsers exchange SDP through the authenticated project API. Character state then flows over a WebRTC data channel.
  • Manual fallback: if the API relay is unavailable, create a peer invite, send the invite text to the other device, and paste its answer back.
  • File exchange: export a JSON bundle of character ids and tombstones, import it on the other device, and the browser merges the states without any network round trip.
  • ICE servers come from deployment configuration (`WEBRTC_STUN_URLS`, optional `WEBRTC_TURN_URL`, `WEBRTC_TURN_USERNAME`, `WEBRTC_TURN_CREDENTIAL`). With none configured, browsers use host candidates only.

Cursors and presence

  • Pointer positions are throttled to roughly eight updates per second.
  • A heartbeat every 15 seconds keeps presence alive; it expires after 30 seconds.
  • Each user gets a stable colour from their id; the label shows their name.
  • A read-only viewer cannot publish presence or edits.

Was this page helpful?