From my observations in the code, disabling note history means that client will neither create any new note history, nor will it clean up existing note history.
If you enable note history on other clients with a given amount of expiry days, that client will still create new note history and cleanup after the set amount of days, regardless of what other clients have set.
So if you combine 90 days expiry on desktop clients and disable note history on mobile clients, it will mean that the cleanup will not happen on mobile, however any cleanup that happened on desktop which has been synced will still need to be applied to your mobile client(s) whenever new cleanup has happened.
It's worth giving it a go right now to see if disabling note history on your mobile makes the deletions settle down, but if the deletions are actually due to your mass import and mass deletions of all your notes, then you would need to complete the synchronisation for that on your mobile regardless of the note history settings.
Yeah, I've got too profiles - one has 1,500 and the other 3,000 files, and syncing them is slow but still manageable. In the past, I had 7,000 files in a single profile, and syncing that was unbearably slow . In fact, the slow sync was the reason why I split my notes into multiple profiles in the first place.
I'm not denying the file access speed is the bottlenock with syncing on your device, but I can't quite understand from all the material I've read why in the case of Joplin, there should be such slowness with file access on newer versions of Android.
Yes there are speed limitations to access files using SAF / FUSE on Android 11 and above, but I have not found any indication that making use of the slow file access api's are necessary for reading / writing files in an app's own data directory, which is the case for Joplin (except if you are using file system sync).
This post on the syncthing-android github suggests that either accessing files in the app's own directory or making use of the MediaProvider api (and therefore making use of the MANAGE_EXTERNAL_STORAGE permission) will bypass any such speed limitations:
The latter solution is unlikely to be an option for Joplin because it would require very strict criteria to be allowed to be published on the play store if it included that permission. However, I can use an alternative app such as ZArchiver (which uses the MANAGE_EXTERNAL_STORAGE permission, aka 'Access all files') on my Android 14 phone, and it will instantly list a directory of 3000+ photos in my camera directory. So that proves it is possible to list a directory with many files in via a third party app, without it being really slow.
So I suspect that as the GrapheneOS developer suggests in the linked post, the problem is not an inherent problem of the Android OS, but rather the file access is not implemented properly to be able to bypass SAF / FUSE within the Joplin app. As Joplin uses react native to manage access to the file system, I suspect the issue lies in a third party library being used. I'm guessing that would be the react-native-fs library.
@tomasz86 I've had a look at the source for react-native-fs and it does look to be using 'app-specific files' type of file access on internal storage (using getFilesDir()) as defined in the Android developer documentation here:
In terms of how the Joplin code uses react-native-fs, it uses it in this file, using the rnfs module:
This is used in combination with the react-native-saf-x library in that file also, using the rnsaf module. So actually the Joplin code clearly distinguishes whether or not to use the storage access framework, depending on the path that the file is located. From what I can tell, if you're not using file system sync, outside of importing / exporting data, only the rnfs module would be used by Joplin, and there should not be any poor performance implications with that on Android 11+. I wonder if the issue might be to do with how the file data is transferred between the javascript and java code through using react native, and if newer versions of Android might affect how that performs for some other reason. As I still can't find evidence to suggest the problem is caused by a limitation in Android. In the case of Syncthing, access to files in a variety of directories is required, so it's not surprising it could face issues due to needing to use SAF
EDIT: This bug report also suggests there should be no performance issues when accessing data within the private application folder:
@jpservices I've reviewed the relevant code again today and actually I remembered incorrectly. Disabling note history will prevent new history being created on that client, but it wont stop the note history cleanup. I didn't realise when you disable note history that the note history expiry setting is still visible, and that still gets used for the the note history cleanup when history is disabled.