All twenty problems
B3What the client asks

“Does it work without internet?”

In a lot of rooms this is a nice-to-have you can talk a client out of. On this continent it is the requirement, and it is weeks of work.

What actually goes wrong

Offline means a local mirror of the data, a queue of writes made while disconnected, a replay when the connection returns, and a policy for what happens when the same record changed on both sides.

Every one of those is a design decision, and getting the last one wrong silently loses somebody’s work.

What Grit does about it

  • Offline support is a command: a local mirror, an outbox for writes, a replay, and a declared conflict policy per resource.
  • The policy is part of the resource definition rather than a second file, so what syncs and how it resolves lives with the resource it describes.

The commands

grit add offline
Declared with the resource
sync:
mode: offline_first
conflict: server_wins
max_offline_age: 72h

What it does not do

Conflict resolution is a business decision wearing a technical hat. Server-wins and client-wins are both wrong for some records, and deciding which is which is yours.

Read next