From 2d807c1a9723edafa6c88da5a8c7b562b68fef46 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 21 Jan 2026 10:22:24 +0000 Subject: [PATCH 1/2] Initial plan From 36259b8e8d3d38fd8e8eb90a3f8a589f8e3f6a44 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 21 Jan 2026 10:25:31 +0000 Subject: [PATCH 2/2] fix: Add thread safety to FileProviderService using QReadWriteLock Co-authored-by: i2h3 <142165879+i2h3@users.noreply.github.com> --- src/gui/macOS/fileproviderservice.h | 2 ++ src/gui/macOS/fileproviderservice.mm | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/src/gui/macOS/fileproviderservice.h b/src/gui/macOS/fileproviderservice.h index 583f197adefcf..98fe8ba9334ff 100644 --- a/src/gui/macOS/fileproviderservice.h +++ b/src/gui/macOS/fileproviderservice.h @@ -7,6 +7,7 @@ #include #include +#include #include "libsync/account.h" #include "libsync/syncresult.h" @@ -62,6 +63,7 @@ class FileProviderService : public QObject class MacImplementation; std::unique_ptr d; + mutable QReadWriteLock _syncStatusLock; QHash _latestReceivedSyncStatus; }; diff --git a/src/gui/macOS/fileproviderservice.mm b/src/gui/macOS/fileproviderservice.mm index daeaabd69f6c3..c3643d36d9c1f 100644 --- a/src/gui/macOS/fileproviderservice.mm +++ b/src/gui/macOS/fileproviderservice.mm @@ -9,6 +9,8 @@ #import "AppProtocol.h" #include +#include +#include #include "accountmanager.h" @@ -119,11 +121,13 @@ - (void)reportSyncStatus:(NSString *)status forDomainIdentifier:(NSString *)doma SyncResult::Status FileProviderService::latestReceivedSyncStatusForAccount(const AccountPtr &account) const { Q_ASSERT(account); + QReadLocker locker(&_syncStatusLock); return _latestReceivedSyncStatus.value(account->userIdAtHostWithPort(), SyncResult::Undefined); } void FileProviderService::setLatestReceivedSyncStatus(const QString &userId, SyncResult::Status status) { + QWriteLocker locker(&_syncStatusLock); _latestReceivedSyncStatus.insert(userId, status); }