Skip to content

Make sync scheduling more predictable - #641

Merged
TheOneRing merged 1 commit into
mainfrom
work/sched
Nov 5, 2025
Merged

TheOneRing merged 1 commit into
mainfrom
work/sched

Conversation

@TheOneRing

Copy link
Copy Markdown
Contributor

No description provided.

@TheOneRing
TheOneRing requested a review from Copilot November 5, 2025 08:58

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors synchronization flow management by removing the syncStarted signal and making sync state transitions more deterministic through direct connections. The changes eliminate asynchronous timing issues in the sync lifecycle by ensuring state updates occur immediately and in the correct order.

  • Removes the syncStarted signal and related logging/handling in FolderMan
  • Changes signal connections from queued to direct connections to ensure proper state ordering
  • Moves showSyncResultPopup() call to execute after state is set in slotSyncFinished

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/gui/scheduling/syncscheduler.cpp Updates connection type to combine DirectConnection with SingleShotConnection; removes extra space in log message
src/gui/folderman.h Removes FolderMan class documentation and unused slot declarations
src/gui/folderman.cpp Removes slotFolderSyncStarted and slotFolderSyncFinished implementations and their signal connections
src/gui/folder.h Removes syncStarted signal and unused _scheduleSelfTimer member
src/gui/folder.cpp Removes unused includes; changes sync initialization to avoid signal emission; updates connection to DirectConnection; changes sync invocation from queued to direct; reorders popup call; removes deferred signal emission

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/gui/folder.cpp
_timeSinceLastSyncDone.start();

setSyncState(definition.paused ? SyncResult::Paused : SyncResult::Queued);
// set the sync state without emiting a signal

Copilot AI Nov 5, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Corrected spelling of 'emiting' to 'emitting'.

Suggested change
// set the sync state without emiting a signal
// set the sync state without emitting a signal

Copilot uses AI. Check for mistakes.
Comment thread src/gui/folder.cpp

if (syncStatus != SyncResult::Undefined) {
setSyncState(syncStatus);
showSyncResultPopup();

Copilot AI Nov 5, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moving showSyncResultPopup() after setSyncState() changes the order of operations. Since showSyncResultPopup() may access _syncResult and this method is now called via Qt::DirectConnection, ensure that any UI updates in showSyncResultPopup() are thread-safe, as the sync engine may be running on a different thread.

Copilot uses AI. Check for mistakes.
@TheOneRing
TheOneRing merged commit 40e5978 into main Nov 5, 2025
@TheOneRing
TheOneRing deleted the work/sched branch November 5, 2025 09:36
@openclouders openclouders mentioned this pull request Nov 5, 2025
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants