The desktop app on the other hand automatically starts syncing 15 seconds after you make a change. The 15 second delay was added due to some kind of issue users were having some years ago, but Iâm not sure whether or not itâs still relevant today.
My recollection is a bit hazy but I seem to recall that a delay was needed because Joplin was syncing instantly when something changed. If you typed 100 characters the entire note was being synced 100 times. That was killing data quotas pretty fast.
@HarSel Thank you for your reply. I had not considered this when I developed the PR, so those changes would likely cause higher data usage unfortunately.
I will make a followup PR to address this. I think the logical thing to do would be to always wait 1 second before automatically re-triggering the sync if there are unsynced changes when the sync completes, as the current implementation on mobile waits 1 second before triggering the sync again if you type something after the sync has completed.
FYI the 15 second delay on desktop may have been a separate issue to addressing excessive data usage, because as I mentioned, mobile only has a 1 second delay, and on mobile is where a limited data plan is more likely to be used.
EDIT: I think the 15 second delay on desktop was added because the sync indicator is always visible, so it might be distracting to some people if itâs always spinning when you type (there was mention of this in discussion about it, but it wasnât sure if this was the main reason or just a secondary reason for it). The way the sync as you type is implemented on desktop is that every time you make another change, it delays the sync another 15 seconds if the sync was already scheduled within the next 15 seconds. So if you are continously typing, youâll never see the indicator spinning unless you stop typing for at least 15 seconds.
I think youâre right on that. It was distracting for sure and the constant updates were making my NAS work overtime. Thereâs always going to be those that want/need instant updates and those who can afford to wait a few minutes before syncing. Iâm in the latter category.
If Joplin starts syncing 15 seconds after making a change, then whatâs the point of Synchronization interval setting?
Laptop users like me would appreciate having âOffline modeâ setting, which would disable automatic synchronization of notes, since thatâs not possible when PC is disconnected from internet.
Yeah, thatâs not possible. Is there a particular reason you would like an offline mode? I think the intention is that automatically syncing outgoing changes while you type means that if a note conflicts, as long as your internet is connected, then you will get the conflict shortly after you start editing an outdated note, rather than after some time of editing. The incoming change interval is presumably configurable so at least Joplin can sync to your preference if youâre just reading your notes
I understand that not everybody would need this, so an option would be great.
For Mac/PC I still think an option to sync upon quitting would solve this.
On iOS/mobile I understand it, as they do not quit when you switch out of the app. And i can see how a constant sync would make the user experience suboptimal.
So background syncing does not happen with Joplin, even if you allow background activity for the app?
With regards to the desktop app, doing a sync on exiting would probably be more viable to implement, but it would need to have a time limit on how long the closing sync could run for (eg. 15-30 seconds) to ensure the app will actually be closed.
Could you not do it like Chrome or other browsers do it? Upon Command+Q, a message that there are unsynced elements and ask the user if they really want to quit (by pressing Command+Q again).
The desktop app on the other hand automatically starts syncing 15 seconds after you make a change. The 15 second delay was added due to some kind of issue users were having some years ago, but Iâm not sure whether or not itâs still relevant today.
Sorry, just seeing this now.
If a sync happens automatically after 15 sec, why is there a preference to sync after 5 min?
Potentially, but certain sync issues which are not apparent in the sync result would result in the prompt opening either during a temporary window, or every time Joplin is closed (as there is no way to detect the specific problem other than to actually run the sync), which might cause confusion to the user if there is no apparent problem.
In particular, this scenario in the code:
If a sync happens automatically after 15 sec, why is there a preference to sync after 5 min?
As mentioned in other responses in this thread, the sync interval configured there is used to pull changes made on other devices, where as the âsync as you typeâ is to push changes
In order to ensure, that all local changes are synced, itâs not necessary to perform full sync on exit. Executing those scheduled 15sec delayed updates in advance would be enough and much faster to perform.
Sure, but a time limit to sync on exit would still be needed as the speed of a partial sync would vary depending on the speed of the sync target and if revisions have been created / deleted etc
You can download this plugin which does something comparable to that:
After installing it, go to extra markdown settings and for the âshow visual sync indicatorâ option select either with an icon or with text. Then in the editor, there will be an indicator in the top right when there are un-synced changes