Sync is blocked while Joplin on Android slowly deletes remote items

Operating system

Android

Joplin version

3.2.7

Sync target

Nextcloud

What issue do you have?

On a new phone, Joplin's initial sync of around 5000 notes was relatively quick, only taking about 10 or 15 minutes to download the notes. The problem is that following the initial download all sync download activity is blocked while the status displays "Deleted remote items: n" as "n" slowly increments. This has yet to complete after nine hours. Is this expected behavior? Is there a way around this? Cancelling does not stop whatever process has taken over. On previous attempts to complete the sync I stopped Joplin and cleared all data and uninstalled. Nothing worked.

There should be a view "deletion log" option in the menu for both desktop and mobile. Have a look at that, and if you see lots of lines which say "Revision.deleteOldRevisions", then yes that is normal.

I'm guessing you are getting many revision deletions on the initial sync because you have set a lower value for the note history keep for setting, compared to on your other Joplin client(s)

Thanks for the advice. The logs show the entries you described. I increased the length of time history is kept, and also increased the number of simultaneous threads for sync in the hope it would speed things up.

UPDATE: This had little effect. I'm in day two of waiting for it to finish. This seems like a bug to me since it blocks all other synchronization while it's deleting the old revisions, making the app useless as a way to share notes.

On your old phone, go to settings, tools synchronization status. It should have a line something like "Revision: x/x". What is the value for the revision line? Is it a really big number or just something small? Normal behaviour would be to just remove revisions as they they expire which should be a small amount if you use Joplin regularly. But if you somehow have hundreds of thousands of revisions being continually deleted, then that would not be normal behaviour

Unfortunately, the old phone has been wiped already. I do have logs from the current phone, which are somewhat puzzling because Joplin claims to be deleting remote items right now, but the logs are all from two days ago on 30 April. I did hit refresh in the log view, but nothing changed. I've attached the logs FWIW.
mobile-log.log (499.6 KB)

I should also say, the first time this started happening last week when I initially transferred Joplin to the new phone, I stopped the app and deleted all the data, then reconfigured it for sync. It did the same thing as I described in the first post above. After a while, I de-installed and re-installed the Joplin app, and that's where I am now, still waiting for the finish of deleting remote items. Does this not sound like a bug?

Information is added to the deletion log when items are deleted locally. The above deletion log includes roughly 6,500 old deleted revisions. I suspect that:

  1. A few days ago, Joplin locally deleted all revisions older than the "Keep note history for" setting -- this is what's shown in the log.
  2. Joplin is now attempting to sync the ~6,000 local revision deletions.

I think it could make sense for Joplin to allow re-prioritizing different sync actions. For example, if an item is created during an ongoing sync, make creating that item a higher priority than any deletions scheduled for the sync.

For now, a workaround might be to:

  1. Make sure you have a recent backup.
  2. Reinstall Joplin.
  3. Set "Keep note history for" to a large number.
  4. Set up sync with Nextcloud.
  5. Sync.
1 Like

Please post the revision count on the new device then. Or if you have another device that is synced, check there.

You could also go on your Nextcloud and check the count of the number of items at the root of the Joplin folder for rough idea of how many objects exist for your profile

There's only 3809 matches on "Revision.deleteOldRevisions" in the log, are you sure you didn't search a term which doubled up the results?

I'm counting the matches with the following script:

function countMatches(text) {
  let count = 0;
  text.replace(/"[a-z0-9]{32}"/g, () => { count ++ });
  return count;
} 

Some of the .deleteOldRevisions lines include multiple IDs.

Ah I see, some lines delete multiple revisions

I marked this as the solution, although it is really just a workaround as you point out. BTW, the max you can set "Keep note history" to is 730, but that got it through a sync. (I had already raised it to about 260, but that wasn't enough I guess.)

1 Like