Repository navigation
Reset folder watcher when ignore pattern changes - #1178
Merged
Merged
Conversation
TheOneRing
force-pushed
the
work/watcher
branch
2 times, most recently
from
October 21, 2026 13:45
e412f43 to
4b3daaf
Compare
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Exclusion reload ordering, failure handling, and watcher and scheduler lifecycle issues introduce correctness and reliability regressions.
6 open issues
Handle exclusion reload failures before continuing synchronization · New Apply updated exclusions before rebuilding Linux watches · New Prevent overlapping syncs during abort and exclusion reload · New Prevent Windows watcher callback use-after-free during backend reset · New Avoid invalidating directory etags on every folder construction · New Destroy the old backend before creating its replacement · New
What changed in this PR
This PR aims to rebuild folder watches when exclusion settings change, so Linux can watch directories that were previously ignored.
Changes:
- Adds a watcher restart API and retains the watched root path.
- Routes hidden-file setting changes through exclusion reloading and discovery invalidation.
- Moves exclusion reloading out of sync startup and adds abort/requeue handling for active syncs.
| File | Description |
|---|---|
src/gui/folderwatcher.h |
Declares restart support and stores the root path. |
src/gui/folderwatcher.cpp |
Implements watcher backend recreation. |
src/gui/folder.h |
Changes reloadExcludes() to return void. |
src/gui/folder.cpp |
Coordinates exclusion reloads, watcher restarts, and synchronization. |
Review effort: Balanced
TheOneRing
force-pushed
the
work/watcher
branch
from
October 22, 2026 08:38
4b3daaf to
dfb1f84
Compare
TheOneRing
force-pushed
the
work/watcher
branch
from
October 22, 2026 08:56
526dd2e to
9993650
Compare
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Synchronous rescheduling can lose active-sync tracking, and exclusion-loading failures lack a recovery path.
2 open issues
6 resolved since last review
Prevent Windows watcher callback use-after-free during backend reset Prevent overlapping syncs during abort and exclusion reload Apply updated exclusions before rebuilding Linux watches Handle exclusion reload failures before continuing synchronization Destroy the old backend before creating its replacement Avoid invalidating directory etags on every folder construction
Review effort: Balanced
Comment on lines
+847
to
+849
| if (!_engine->reloadExcludes()) { | ||
| _syncResult.appendErrorString(tr("Failed to load excludes")); | ||
| setSyncState(SyncResult::SetupError); |
The linux file watcher uses the ignore list to decide what folders to watch, if the lists changes we have to repopulate the watchted folders.
TheOneRing
force-pushed
the
work/watcher
branch
from
October 22, 2026 09:05
9993650 to
d3be8d2
Compare
| doReload(wasRunning); | ||
| FolderMan::instance()->scheduler()->enqueueFolder(this); | ||
| }, | ||
| static_cast<Qt::ConnectionType>(Qt::SingleShotConnection | Qt::QueuedConnection)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.


The linux file watcher uses the ignore list to decide what folders to watch, if the lists changes we have to repopulate the watchted folders.