laurent22 / joplin

Joplin - the privacy-focused note taking app with sync capabilities for Windows, macOS, Linux, Android and iOS.
https://joplinapp.org
Other
46.34k stars 5.04k forks source link

90%+ of notes deleted because of sync with failsafe enabled #11295

Open Brywyrkuki21 opened 1 month ago

Brywyrkuki21 commented 1 month ago

Operating system

Android

Joplin version

3.0.8

Desktop version info

No response

Current behaviour

  1. Was creating new notes and switching applications between edits
  2. Find the note I've been editing was not open
  3. try to open it, find only 2 notebooks out of 10 and 8 conflicted notes(were 50+ notes missing)
  4. Opened desktop joplin with wifi off, exported all notes as well as the remaining ones on phone
  5. Went to onedrive(where I sync) and restored all deleted data
  6. tried to sync, still didn't work
  7. On desktop reuploaded all local data to sync target
  8. Somehow all data was restored on both the phone and desktop, there were stuff that weren't previously on desktop because of unuse of the desktop application, but they synced from phone even though they didn't show up on phone after mis-sync
  9. No data lost in the end seemingly

Expected behaviour

If fail-safe is enabled, android app should behave as the desktop app, and not delete a random 90% of notes without any warning in 10 seconds or so with no easy/sure way to restore them. At least move them to trash first, its not like moving them to trash first for like 1 day or 1 week will take up a noticeable amount of space I would really appreciate if the backup plugin finally came to the android version because it would provide an extra layer of protection against unwanted situations like this Sorry if problem is a duplicate or smth, if I can/should provide more info I will

Logs

No response

mrjo118 commented 1 month ago

I can't quite understand all the steps in the current behaviour section. In particular, I don't understand what you did in steps 2 to 5. If you modified the data on onedrive manually, you shouldn't really do that if you are taking the data from exports, as the note / object ids wont be the same.

As far as I'm aware, failsafe only protects you from deleting 'everything', where the sync target is completely empty. If it has even just 1 note on the sync target then I don't think the failsafe will kick in.

Regarding having a backup plugin on android, that would certainly be welcomed.

mrjo118 commented 1 week ago

Actually I was wrong about failsafe. Looking in the code it should kick in if 90% of notes or over will be deleted in one go, as you mentioned. The failsafe behaviour is shared between desktop and mobile, so I suspect it is an issue with the OneDrive sync, as there have been at least 2 other recent reports of people having similar issues when syncing with OneDrive, both of which were to the desktop version of Joplin.

In light of this, laurent has actually deprecated syncing to OneDrive in the latest pre-releases of Joplin, as it is too much work to maintain. That means OneDrive sync will still be available to use in Joplin indefinately, but it's no longer going to receive any fixes unfortunately, so it would be wise to switch to an alternative sync target.