I have been using Joplin for years on my laptop and mobile phone and sync to dropbox. My mobile OS is android. Recently I just upgraded to a new android phone and downloaded joplin (v3.1.8) and immediately set it up to sync with the existing dropbox sync target.
It appeared to sync fine and downloaded all the thousands of notes. Then I clicked sync again and it started saying it was deleting notes. It got into the hundreds of notes deleted when I realized something wrong was happening because many of my most recent notes which had been on my mobile device a moment ago were now gone.
I disabled wifi on my phone and went to the computer and disabled wifi there. All my notes in desktop appeared intact so I made extra backups and exports. I also upgraded my desktop to the latest version 3.1.24 at that point, because it was still an older version in the 2's. Then I turned on wifi and sync again on the desktop app. Upon syncing, no notes were being deleted. That was strange but I felt relieved that even though they were being deleted from mobile somehow that did not transfer to desktop, and presumably they were not deleted from dropbox as well.
Finally I deleted joplin on my phone and re-downloaded the app to setup sync again in case I did something wrong the first time. I synced and while it was syncing I followed the prompt to enter my encryption password so that it could decrypt the notes. It continued to download and decrypt all the notes. After it finished I pressed sync a second time. Again, the mobile app immediately started deleting notes.
So I turned off sync on my mobile and closed the app. I confirmed that desktop again did not delete any notes upon syncing.
So that's where I am now. I am hoping someone can shine light on this problem and help me figure out how to sync my mobile without it auto deleting all the notes after it syncs!
Sorry to hear about the hassle. I've had a few sync issues in the past, though not exactly this. My advice comes with the caveat that I'm no Joplin sage or expert but hopefully it is fairly sensible. It looks like something is up with the data on your sync target. A couple of ideas to try -
Look at your Dropbox folders and see if there are any lock files in Lock or Locks. I believe it should be safe to delete them if so. Then try your syncing process again to see if something was "stuck".
In my experience the best - but unfortunately the most time-consuming - way to solve sync problems is to manually delete all the sync target data and re-set it up again (I've lost count of the amount of times I've done this!). Like you already have done, make sure your desktop data is safe and do back it up again first as well. Then delete everything on Dropbox (the Joplin folder) and restart the sync process from scratch with a new token to re-upload everything. When it's done, sync to your phone, making sure you leave the phone screen on with the app open for the full sync.
I'm 99.9% sure #2 will solve this and done carefully there should be no risk.
I hope that helps. Someone else of course might know a better way!
I've had a similar problem with sync from Android to Joplin cloud. I have about 3000 notes stored in Joplin and have used the app for years, syncing across Android (Pixel 6 pro) and PCs (Windows 10 & 11) with no problems, really appreciating Joplin's efficiency and the cloud sync.
Two or three days ago the sync function on my Android suddenly started deleting large numbers of remote files (I had not deleted any notes on the local Android device or any other device). It got up to two or 300 files deleted before I noticed. I immediately shut down Joplin on the Android and closed the internet connections on my other devices that run Joplin.
I uninstalled Joplin from the Android and reinstalled, then began the synchronization process. It went on for many hours and finally appeared to (possibly?) be complete, but things looked awry: the number of items imported was five times the total number of notes and attachments that I have. I don't use tags or notebooks much, so the count looked very excessive.
After synchronizing something on the order of 15,000 objects, the total number of notes in Joplin on the Android app was only about 50 or 100 -- in other words, about 2900 of my notes were missing -- terrifying! I uninstalled Joplin again, since I have no confidence that it will function properly on Android.
It's been a lot of work to deal with this already (making multiple backups, finding notes that had been saved on one device but not yet synced on others etc). Plus, I currently don't dare to use Joplin while connected to the internet, since it might synchronize to a much-diminished set of notes.
If there's a simple solution, I would really like to keep using Joplin. However, my confidence is very much shaken.
Any help would be greatly appreciated! Also, if I should post this to a new topic please let me know -- I'm not familiar with protocols on GitHub.
Be aware that "items" in deleted remote items and created local items includes revisions, in addition to notes, tags, and resources. I'm linking two related posts:
deleted remote items can list a large number of non-note items when old revisions are removed. When revisions are removed is determined by the "keep note history for" setting in "settings" > "note history".
@personalizedrefriger your comments are most helpful. I decided to let the mobile run all the way through the deletions in case they were indeed revisions being deleted.
The mobile finally did finish and nothing is being deleted on the desktop still. They both seem up to date and I am not seeing any deleted notes on either side.
I am really happy about this after the initial scare. However I can't see why so many revisions would be deleted on the mobile because mobile and desktop are both set to keep 730 days of note history.
In the logs the delete records don't show any helpful indicator whether the note being deleted was a revision or not, just a hashed ID.
Anyway, it seems like things are fine and I was alarmed because I didn't understand what the deletes were. Thank you everyone for the help and feedback!