Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Desktop,Mobile,Cli: Fixes #9800: Fix synchronization happens every 10 seconds even if nothing has changed #9814

Conversation

personalizedrefrigerator
Copy link
Collaborator

Summary

This fixes a sync info comparison issue caused by a typo in 7b06090.

Because

  1. 0.0.0 was written as 0.00 in SyncInfo::load and
  2. mergeSyncInfos preferred the remote appMinVersion to the local appMinVersion if equivalent (0.0.0 is equivalent to 0.0.0)
    sync targets that didn't have an appMinVersion property had it initialized to 0.00.

Because '0.0.0' !== '0.00', syncInfoEquals would return false on each sync, causing the sync target remote info to be updated. During mergeSyncInfos, the remote version (0.00) was selected, and thus, the sync target continued to have 0.00 in its info.json.

The fix involves

  1. correcting the typo (0.00 -> 0.0.0)
  2. preferring the local version to the remote version in mergeSyncInfos when the versions are otherwise equal.

Fixes #9800.

Testing

  1. Sync Joplin with a sync target that was first initialized with Joplin 2.14.10 or older.
  2. Wait 10-20 seconds and verify that it doesn't sync again.

This has been tested successfully on Ubuntu 23.10 (sync interval set to 1 hour).

… every 10 seconds even if nothing has changed
@laurent22 laurent22 merged commit 236d977 into laurent22:dev Feb 2, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Synchronization happens every 10 seconds even if nothing has changed
2 participants