Home / GitHub Page

Thanks enormously for the failsafe! And feature request(s)

Wowsers! I just replaced my Nexcloud server. Rather than try migrating data I thought I’d just sync my local stuff to it.

The Nextcloud client went bananas and deleted most of my local stuff yet not all? Odd. Sweating bullets I was glad I made a local copy just before! So I’m rsyncing it back and am watching the NExcloud client sync it up again. That will include the Joplin stuff.

But I didn’t think to explicitly back up Joplin and was blown away when you failsafe notice popped up in the corner. Wow, thanks so much. But I have two requests:

Firstly the message could be clearer regarding data compromise. It says: Last error: Fail-safe: Sync was interrupted because 97% of the data (704 items) is about to be deleted. To override this behaviour disable the fail-safe in the sync settings.

I’m bamboozled. Why do the clients do this? Is this not crazy? The Nextcloud database knows nothing it certainly can’t report back that an item ever existed. I mean if it reported back that it once existed and was removed, then that should trigger a local remove. But if it reports back that it’s never heard of that item, surely that demands a push to cloud server? What am I not getting. Either way, the request is, to add to this message a really 100% clear indication of whether anything was lost or not. If the failsafe did not delete ANY local data that is WORTH saying explicitly and will save much angst. And if any was lost, please be explicit so we know what to shed tears over. But above all thanks from the bottom of our hearts for the failsafe.

The second request is for an explicit option to flag the server as new, and do a local push to remote. Force a local to remote push to start the ball rolling. It’s worth noting that floccus (which syncs to Nextcloud) has just such an option. And it rocks.

1 Like

If you switch from a folder that has notes to a folder without notes, Joplin will think that you’ve deleted everything and so will proceed to delete everything locally. Sometimes that’s what you want but sometimes not, so that’s why this fail-safe was added.

There’s also a warning below the Nextcloud URL field but it seems few people read it, so I’m going to remove it as part of the UI re-design.

The second request is for an explicit option to flag the server as new, and do a local push to remote.

It’s been discussed many times and will probably be implemented at some point.

You mean there is element of the WebDav protocol that differentiates between:

  1. That file is not here - it never was.
  2. That file is not here - but it was once, and has been deleted.

Yes it keeps track of what it has seen before, to allow synchronising deletion operations.

What does? the Nextcloud server? Or the Joplin app on the Nextcloud server? Or the Joplin desktop app?

The Joplin clients have all the sync logic.

I was asking about the WebDAV server in Nextcloud. Csn it it not tell the Joplin client whether:

  1. That file is not here - it never was.
  2. That file is not here - but it was once, and has been deleted.

I’m guessing not from your prior comment that the whole logic is in the Joplin client. Meaning it doesn’t get this clue from the Nextcloud server (and arguably should be able to as the Nextcloud server sure knows as it keeps history on files).

But it does know that. The first time you sync, Joplin is going to see what files are there and keep a record of it. If you delete all the files on the server, it will see on the next sync that the files are now gone (“2. That file is not here - but it was once, and has been deleted”), and since it’s been deleted on server it should be deleted locally too.

Not sure if I’m making sense here, it’s two way sync basically. What you do on the server affects the clients and vice-versa.

Well here is my real question and confusion, I’ll try and clarify.

  1. Joplin has file X, and asks Nextcloud about File X

Scenario 1:
2. Nextcloud responds that it does not have file X but once had that file.
3. Joplin deletes the file locally

Scenario 2:
2. Nextcloud responds that it does not have file X and never had it.
3. Joplin should push the file to Nextcloud.

If that is how it works, how can pointing Joplin at a new Nextcloud (never had any files) cause anything but a push to server of all local files?

What am I not getting. My conclusion is the two scenarios cannot be differentiated because Nextcloud only ever responds “I don’t have that file”, it never provides the extra detail as to whether it once did have that file or not.

Am I following?

This is correct.

Additionally, each client stores some information on each file i.e. I have file X and I have successfully synced it to the server in the past.

That’s a real shame. Nextcloud should be smarter than that. It should be able to query it for the history of a given file. Because it certainly keeps one,

Unfortunately the WebDAV protocol that Nextcloud and other services use is quite limited. In particular, unlike OneDrive or Dropbox, it doesn’t provide a “delta” API that would tell us what has changed since last sync.

So it needs to be done by the client, by comparing what we have to what’s on Nextcloud. It’s an inefficient process that doesn’t scale well, but so far there’s no alternative for WebDAV sync.

git could handle that behavior, did nt it ?
but which fool will use git to sync stuff ^^