Offline-first is mostly about conflicts
Caching is the easy part. Notes on field-level patches, stale-write refusal and private data when two phones edit the same book offline.
Making an app open offline takes an afternoon. Making two devices that were both offline agree afterwards takes the rest of the project.
Patch fields, not documents
Sending whole documents means the last writer silently erases the other person's change. Sending field-level patches shrinks the collision surface to the fields both people actually touched.
Refuse stale writes on the server
Every document carries an updated-at stamp. Security rules refuse any update stamped earlier than the stored copy. When the app sees a refusal it fetches the server copy to decide whether this is a real conflict — the other phone changed or deleted this — or an ordinary error, and shows one notice per burst instead of a wall of errors.
Privacy is a query shape
Rules that hide private notes from the other user can't be satisfied by one broad query, so the app reads shared notes and the reader's own private notes separately and merges them. The server, not the UI, enforces privacy.
Idempotent background work
Recurring bills post automatically. Using transactions to create-if-absent means two devices waking up at once still post each bill exactly once.
Keep reading
Printing from the cloud to a printer on someone else’s Wi-Fi
Why the agent must dial out, how five printer transports differ, and why the bridge refuses to talk to public addresses.
Oct 2026
Reading a million-line file in a browser tab
Workers own the bytes, the main thread owns the pixels, and a scroll position is “line N plus an offset” — not a giant spacer.
Sep 2026