Understanding syncing process

I have a question about that process.

I discribe what I suppose the processs does, correct me when I'm wrong :slight_smile:

If I create 10 notes with 10 ressources each, Joplin will sync all of them with the cloud service.
I decide to drop all that 10 notes , because that was for a test, Joplin syncs that too.

What's happened on the mobile ?

  • Does joplin do nothing because the 10 creations and 10 deletions of the same notes, cancel themselves ?
  • Joplin creates the 10 notes on the mobile and then delete them after ?
  • Joplin does not create the 10 notes but download the 100 ressources and will delete them later in a couple of day ?

I feel that joplin does the 2nd as if joplin worked on logs of each event that occurs, without specifically knowing the existing data on the target, and just repeat the log, that happens on the desktop, on the mobile.
However, I did not see anything on the cloud service that allows to exchange any logs, so may be it's the third .

Well I think there are two cases:

Case 1

  • Desktop: You create the notes and resources, sync them, then delete them.
  • Mobile: You sync: you get the 100 items.

This is because indeed the mobile cannot know that the desktop deleted all the items since the desktop didn’t sync.

So there’s the second case:

Case 2

  • Desktop: You create the notes and resources, sync them, then delete them. And then you sync.
  • Mobile: Nothing happen, it won’t pick up any new item.

Basically the rule is that if it’s on the sync target, it will be picked up by all the clients regardless of what happened in any other client. Likewise, if you delete and sync, the items will be deleted from the target and not synced with any client.

There’s no log for synchronisation, it’s all based on the “updated_time” and “sync_time” properties. Basically if updated_time > sync_time, the item will be uploaded to the sync target. Otherwise there’s a deleted_items table where the locally deleted items go, and then it’s used to delete on the sync target.


Perfect, I understood