Desktop: Warn the user when not all outgoing changes have been synced before exiting #13845
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This serves as an alternative to PR #13312. While not as comprehensive at warning the user about potential sync issues, this change helps reduce the possibility of the user getting note conflicts when using Joplin desktop.
Joplin desktop has a delay of 15 seconds before it automatically triggers the sync as a result of making a change to a note, in contrast to the mobile app which has a mere 1 second delay (the period is longer on desktop because the sync button is always visible and is distracting to some users if it is spinning too frequently). This means that if a user quits Joplin desktop without waiting 15 seconds after their last change and without clicking the sync button manually, they will get a conflict if they edited the same note another device without first returning to the original device.
This PR seeks to address this issue by opening a warning prompt upon quitting Joplin desktop, warning that not all changes have been synced, if a scheduled sync originally scheduled by an outgoing change has not yet completed. The prompt is a question dialog, which gives the user the option to either cancel quitting Joplin (so they can manually run the sync, or let it complete if in progress), or ignore the warning and quit anyway.
Implementation details
Testing
Testing has been done for the scenarios detailed in the implementation details above. Additionally, the following scenarios have been tested:
See video demonstrating test cases for most of the above:
Joplin_hZvFrPqWty.mp4