How it works
How sync works
Sempere has no sync server. Each device works on its own complete copy and syncs it both ways with sync targets you choose. How it schedules, what the status says, and how edits merge.
Sempere does not run a sync service. Each device keeps a complete copy of the vault inside the app and works only on that copy, so nothing waits for a network. To share the vault between devices, give it sync targets (Where to keep your vault): a shared <Name>.sempere folder in iCloud Drive or elsewhere, or a WebDAV server. Other devices open the target and join by approval, and each device syncs its copy with the targets both ways. A backup is a separate snapshot for recovery that nothing syncs from. Every save is a new file with a unique name (Inside a vault), so syncing is mostly copying new files, and edits from several devices merge when the app reads them.
When it syncs
- shortly after you make a change;
- when the app opens or comes back to the front, and when it goes to the background;
- when you unlock the vault, and when the network comes back;
- on Sync Now (in the sync bar’s menu, or Sync Targets…);
- otherwise every few minutes, more often while changes are arriving.
On iPhone and iPad, a running sync finishes in the background, and vaults that are not open keep uploading their changes, voice notes included.
Open and closed vaults
The open, unlocked vault syncs both ways. A vault that is closed or locked only uploads: what other devices wrote waits on the device, unread, and the bar says “n files from other devices are on this device and arrive when the vault is unlocked”. They are checked and placed when you unlock.
Every file is checked
A file that arrives is checked before it is placed: it must decrypt under the vault’s keys, and its authentication tag, name and structure must be right. A file that fails is kept aside, never put in the vault and never deleted; Sync Targets… ▸ Details and Repair lists such files with Adopt, Export… and Delete…. So a misbehaving server or a planted file cannot slip into your notes.
The sync bar
The bar under the note list says how things stand:
- syncing, or synced (with how many files are still on their way);
- “n changes not synced yet”;
- offline: “Changes are kept on this device and sync when the server can be reached”, which is not an error;
- for an iCloud Drive folder, “n changes waiting for iCloud to upload”: Sempere has written them to the folder, and iCloud has not uploaded them yet;
- a problem and what to do: a wrong password, a certificate that changed, a folder that is gone or holds another vault, or files that failed.
Sync Targets… lists every target with its state. Details and Repair shows, per target, its last sync, files in step, and the devices whose notes it held, which helps when one device seems not to see another: devices only meet through a target they share.
Several targets
A vault can have any number of targets. A device that syncs with two of them, say iCloud Drive and a NAS, carries what arrives from one to the other. Removing a target never deletes anything there.
How edits merge
The merge is the same whichever way the files travel:
- ink, pages and items from every device are kept; a deletion wins;
- the title, notebook, paper and other single values take the latest change;
- a tag added on one device survives a removal made at the same time on another;
- shared settings merge setting by setting.
So you can write on the iPad on a plane and on the Mac at your desk, and both sets of strokes are in the note once the devices sync. A note open on one device updates in place when the other’s changes arrive (“Updated from another device”).
Device changes travel the same way
Approvals, removals and other device changes are files too (vault.json, epochs/, joins/), carried by the same sync to every target. A device that was told it was removed stops uploading. See Devices and keys.
Deleted notes
Deleting a note is an edit like any other: it moves the note to Recently Deleted on every device. Restoring it on any device brings it back everywhere.
The CLI
sempere sync webdav and sempere sync folder sync a vault folder two ways with a WebDAV folder or another folder, with the same checks; sempere store sync runs a vault’s sync targets as the app does. See WebDAV and NAS setups.