Skip to content

Automerge

Automerge is a library that lets separate copies of a document be edited and combined when they exchange changes.

Visit Automerge

What happens if two people edit the same checklist offline?

If each person changes a different item, Automerge can combine both changes when the copies sync. If they set the same field to two different values, both copies show the same chosen value. Your app can inspect the conflicting values and ask a person to decide which one to keep.

This makes edits converge. For a scarce resource like the last appointment time, the service that accepts the booking still needs to enforce who gets it.

What actually carries and saves the changes?

In a JavaScript app, Automerge holds the document and Automerge Repo connects it to storage and a network. The browser can save the local copy in IndexedDB, its built-in database. To reach another device, use a network connection such as a WebSocket to a sync server. Configure storage there too if the document must be available when the editors leave.

Two tabs can sync within one browser using BroadcastChannel, which does not prove a connection to another device works. The project’s community server is an experimental public demo. Keep private documents on an access-controlled system you operate or choose.

Does someone with a document link get to read it?

A document URL identifies the document. Decide who can retrieve it using your app’s sign-in and access checks wherever a copy can be served. For a private setup, verify who is connecting and check membership before the sync endpoint shares a document. Hiding the link in the interface does not enforce that boundary.

Check who can read and who can make changes in your actual app. Revoking access does not erase a document already saved to a device.

How do you prove changes crossed devices and survived a disconnect?

Use a disposable app and a private test sync server with a fictional checklist. Verify the app’s network adapter, sign-in, stored documents and callbacks all point at the test setup. If you cannot confirm those routes, trace the network and storage settings or sketch the two edits without connecting.

  1. Establish an online baseline
    Open the same test checklist as two allowed editors in separate browser profiles or devices. Change one item in the first and confirm the second sees it without a refresh.
  2. Take one editor offline and test the merge
    Disconnect only the second editor and confirm its connection to the sync server is down. Keep the first connected. Change one item on each copy and check the offline change has not reached the first. Reconnect the second and confirm both changes appear in both copies.
  3. Check that a copied link gives no access
    In a clean profile signed in as a fake nonmember, request the same test document through the test app. Check that its sync endpoint denies access and no document content reaches the browser. If the page blocks before a sync request or your demo has no access check, mark sync-level access untested and inspect the test server rule separately.

What do you need to pay for and keep?

The core Automerge library has an MIT license. Budget for the sync service, storage, backups and upkeep. To keep a test document outside the app, export its binary format using Automerge’s save operation. Load it into a clean document and verify the checklist and the changes you need. Keep accounts, memberships and external files separately.

The binary document can retain editing history. Treat it as sensitive even if some of the text no longer appears on screen.