fix: Add thread safety to FileProviderService sync status tracking#9348
Merged
i2h3 merged 2 commits intoi2h3/fix/9682755-excluded-sync-statusfrom Jan 21, 2026
Merged
fix: Add thread safety to FileProviderService sync status tracking#9348i2h3 merged 2 commits intoi2h3/fix/9682755-excluded-sync-statusfrom
i2h3 merged 2 commits intoi2h3/fix/9682755-excluded-sync-statusfrom
Conversation
Co-authored-by: i2h3 <142165879+i2h3@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update based on feedback for file provider synchronization fix
fix: Add thread safety to FileProviderService sync status tracking
Jan 21, 2026
i2h3
approved these changes
Jan 21, 2026
2ce4d4e
into
i2h3/fix/9682755-excluded-sync-status
6 of 7 checks passed
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds thread safety to the FileProviderService's sync status tracking mechanism, which was previously accessing a shared QHash without synchronization from multiple threads (Qt GUI threads for reads and XPC threads for writes).
Changes:
- Added
QReadWriteLockmember variable to protect_latestReceivedSyncStatusQHash - Implemented read locks for concurrent read operations in
latestReceivedSyncStatusForAccount() - Implemented write locks for exclusive write operations in
setLatestReceivedSyncStatus()
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/gui/macOS/fileproviderservice.h | Added QReadWriteLock member variable and necessary include |
| src/gui/macOS/fileproviderservice.mm | Added QReadLocker/QWriteLocker includes and lock guards to protect QHash access |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Description
The
_latestReceivedSyncStatusQHash inFileProviderServicewas accessed from multiple threads without synchronization: reads from Qt threads vialatestReceivedSyncStatusForAccount()and writes from XPC threads via the Objective-C delegate callback insetLatestReceivedSyncStatus().Changes
QReadWriteLockto protect_latestReceivedSyncStatusaccessQReadLocker(allows concurrent readers)QWriteLocker(exclusive access)QReadWriteLock chosen over QMutex for read-heavy workload optimization.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.