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

Synchronization happens every 10 seconds even if nothing has changed #9800

Closed
iJorgen opened this issue Jan 29, 2024 · 5 comments · Fixed by #9814
Closed

Synchronization happens every 10 seconds even if nothing has changed #9800

iJorgen opened this issue Jan 29, 2024 · 5 comments · Fixed by #9814
Labels
bug It's a bug desktop All desktop platforms high High priority issues sync sync related issue

Comments

@iJorgen
Copy link

iJorgen commented Jan 29, 2024

Operating system

Linux

Joplin version

2.14.11

Desktop version info

Joplin 2.14.11 (prod, linux)

Client ID:
Sync Version: 3
Profile Version: 45
Keychain Supported: No

Revision: 0f9d6a1

Simple Backup: 1.3.6

Current behaviour

The desktop client checks for changes every 10 seconds even if no changes are made. This happens 24/7 and it finds nothing to synchronize, just the spinning wheel and a message that it's completed "Completed: 2024-01-29 16:40 (2s)".

Using "1 hour" as the "Synchronization interval" under settings.

Expected behaviour

Follow the setting under "Synchronization interval" or sync only after a while when changes are made locally.

Logs

No response

@iJorgen iJorgen added the bug It's a bug label Jan 29, 2024
@marph91
Copy link
Contributor

marph91 commented Jan 31, 2024

Same for me:

  • Joplin 2.14.11 (prod, linux)
  • Synchronization interval: 5 minutes
  • Sync target: self-hosted nextcloud

@personalizedrefrigerator
Copy link
Collaborator

I can reproduce this with Joplin Server sync (synchronization interval: 1 hour, Joplin in dev mode, v2.14.11), but not filesystem sync.

@personalizedrefrigerator personalizedrefrigerator added desktop All desktop platforms sync sync related issue high High priority issues labels Feb 1, 2024
@personalizedrefrigerator
Copy link
Collaborator

I'm getting a large number of

10:02:21: App: "syncInfoCache" was changed - setting up encryption related code

messages in the log.

The relevant code seems to trigger a sync 10 seconds in the future:

// changed. This is not optimal but:
// - The sync target info rarely changes.
// - All the calls below are cheap or do nothing if there's nothing
// to do.
'syncInfoCache': async () => {
if (this.hasGui()) {
appLogger.info('"syncInfoCache" was changed - setting up encryption related code');
await loadMasterKeysFromSettings(EncryptionService.instance());
void DecryptionWorker.instance().scheduleStart();
const loadedMasterKeyIds = EncryptionService.instance().loadedMasterKeyIds();

});
// Schedule a sync operation so that items that need to be encrypted
// are sent to sync target.
void reg.scheduleSync();
}

public scheduleSync = async (delay: number = null, syncOptions: any = null, doWifiConnectionCheck = false) => {
this.schedSyncCalls_.push(true);
try {
if (delay === null) delay = 1000 * 10;
if (syncOptions === null) syncOptions = {};

@personalizedrefrigerator
Copy link
Collaborator

From a git bisect, 7b06090 seems to be the first commit with this issue.

@stevemagruder
Copy link

stevemagruder commented Feb 2, 2024

I've noted this in the Joplin forum, but this applies to the Windows app as well. I'm seeing the same issue happen with a 30-minute interval set. (this is a "for the record" statement, given the above code fix covers Windows too)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug It's a bug desktop All desktop platforms high High priority issues sync sync related issue
Projects
None yet
4 participants