Skip to content

File Provider Remote Change Discovery Fix#9424

Merged
i2h3 merged 5 commits intomasterfrom
i2h3/fix/remote-change-discovery
Feb 5, 2026
Merged

File Provider Remote Change Discovery Fix#9424
i2h3 merged 5 commits intomasterfrom
i2h3/fix/remote-change-discovery

Conversation

@i2h3
Copy link
Collaborator

@i2h3 i2h3 commented Feb 4, 2026

  • Changed: The file provider extension no longer polls or listens for server-side changes by itself.
  • Changed: The main app, an already existing dependency, is the only process checking for server-side changes.
  • Changed: The Enumerator in the file provider extension now also checks the locally materialized items for changed ETags on the server to discover remote changes.
  • Removed: RemoteChangeObserver, MockNotifyPushServer and related tests.

Closes #8510.

@i2h3 i2h3 added this to the 33.0.0 milestone Feb 4, 2026
@i2h3 i2h3 self-assigned this Feb 4, 2026
Copilot AI review requested due to automatic review settings February 4, 2026 13:40
@i2h3 i2h3 added the bug label Feb 4, 2026
@github-project-automation github-project-automation bot moved this to 🧭 Planning evaluation (don't pick) in 💻 Desktop Clients team Feb 4, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request fixes a bug where the macOS File Provider VFS was not properly detecting and reflecting server-side changes (renames, deletions, etc.). The fix restructures the remote change detection architecture by moving responsibility from the File Provider extension to the main application.

Changes:

  • Moved remote change detection from File Provider extension to main app's existing polling/push notification infrastructure
  • Added root ETag tracking in FolderMan to detect changes for File Provider domains
  • Integrated File Provider domain signaling with both polling and push notification flows
  • Removed RemoteChangeObserver class and its associated test infrastructure from the File Provider extension

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/gui/macOS/fileproviderdomainmanager.h Made signalEnumeratorChanged public to allow calls from FolderMan
src/gui/folderman.h Added _accountRootETags hash to track root ETags per account for File Provider domains
src/gui/folderman.cpp Added ETag polling logic for File Provider domains and integrated signaling with push notifications
shell_integration/MacOSX/NextcloudIntegration/FileProviderExt/FileProviderExtension.swift Removed RemoteChangeObserver instantiation and setup
shell_integration/MacOSX/NextcloudFileProviderKit/Sources/NextcloudFileProviderKit/Enumeration/Enumerator.swift Added checkMaterializedItemsOnServer method to detect remote changes during working set enumeration
shell_integration/MacOSX/NextcloudFileProviderKit/Sources/NextcloudFileProviderKit/Enumeration/RemoteChangeObserver.swift Deleted - functionality moved to main app and Enumerator
shell_integration/MacOSX/NextcloudFileProviderKit/Tests/NextcloudFileProviderKitTests/RemoteChangeObserverTests.swift Deleted - tests for removed RemoteChangeObserver class
shell_integration/MacOSX/NextcloudFileProviderKit/Tests/NextcloudFileProviderKitTests/RemoteChangeObserverEtagOptimizationTests.swift Deleted - tests for removed RemoteChangeObserver class
shell_integration/MacOSX/NextcloudFileProviderKit/Tests/Interface/MockNotifyPushServer.swift Deleted - test infrastructure no longer needed
Comments suppressed due to low confidence (1)

shell_integration/MacOSX/NextcloudFileProviderKit/Sources/NextcloudFileProviderKit/Enumeration/RemoteChangeObserver.swift:1

  • The authenticationChallenge handler for NSURLAuthenticationMethodServerTrust unconditionally created a URLCredential from serverTrust and completed with .useCredential without validating the certificate chain, effectively disabling TLS server certificate verification for this connection and enabling man-in-the-middle attacks. An active network attacker presenting an arbitrary or self-signed certificate could have it accepted and intercept or modify all traffic for the affected account. Removing RemoteChangeObserver (and thus this delegate) resolves the issue for this extension as long as remaining NextcloudKitDelegate implementations rely on the default system trust evaluation rather than similarly bypassing server trust checks.

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

@i2h3
Copy link
Collaborator Author

i2h3 commented Feb 4, 2026

This somehow does not work for the push notification method. The main retrieves the current ETag of the root on the server but it apparently is unchanged despite a file being added to the root on the server through web user interface.

@TheGranadilla
Copy link

Please i2h3 Save us 🤣

Copy link
Member

@nilsding nilsding left a comment

Choose a reason for hiding this comment

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

Overall nice, thanks :)

In a future change this will be really useful to send the specific file IDs to the File Provider extension to even further limit the amount of requests required, but IMO that is out of scope for this PR here.

@Floweb05
Copy link

Floweb05 commented Feb 4, 2026

Hi,
My true appologizes if I'm polluting this with my question... (Huge stress-time over here)
Can you tell if that PR that aim to better detect changement, will fix bugs where :

  1. WEB-UI : I delete folder/folder/folder/deleteme -> VFS Sync client don't detect deletion and keep deleteme/
  2. Mac VFS client : I add a folder "new" in /folder/folder/folder/ -> VFS client don't detect it and don't sync it to server

From what I understand it's totally that.
You are trying to fix the "recursive" detection, but I may be wrong :S

Thanks a lot everyone.

@i2h3 i2h3 force-pushed the i2h3/fix/remote-change-discovery branch from e69b12e to f839afb Compare February 5, 2026 09:39
@Rello Rello moved this from 🧭 Planning evaluation (don't pick) to 🏗️ In progress in 💻 Desktop Clients team Feb 5, 2026
i2h3 added 3 commits February 5, 2026 12:57
- Changed: The file provider extension no longer polls or listens for server-side changes by itself.
- Changed: The main app, an already existing dependency, is the only process checking for server-side changes.
- Changed: The Enumerator in the file provider extension now also checks the locally materialized items for changed ETags on the server to discover remote changes.
- Removed: RemoteChangeObserver, MockNotifyPushServer and related tests.

Signed-off-by: Iva Horn <iva.horn@nextcloud.com>
…edServerDirectoryShouldNotBeEnumerated

Signed-off-by: Iva Horn <iva.horn@nextcloud.com>
Signed-off-by: Iva Horn <iva.horn@nextcloud.com>
@i2h3 i2h3 force-pushed the i2h3/fix/remote-change-discovery branch from f839afb to 5cc1630 Compare February 5, 2026 11:57
@i2h3
Copy link
Collaborator Author

i2h3 commented Feb 5, 2026

@Floweb05 I tested the exact cases you described with the changes in this pull request it works as expected.

@i2h3 i2h3 enabled auto-merge February 5, 2026 12:11
@i2h3 i2h3 requested a review from nilsding February 5, 2026 12:11
@github-actions
Copy link

github-actions bot commented Feb 5, 2026

Artifact containing the AppImage: nextcloud-appimage-pr-9424.zip

Digest: sha256:4c24db8969efc76f08cc0db356192a89a03259e2d7e627882cef119b42197f2e

To test this change/fix you can download the above artifact file, unzip it, and run it.

Please make sure to quit your existing Nextcloud app and backup your data.

@Floweb05
Copy link

Floweb05 commented Feb 5, 2026

@Floweb05 I tested the exact cases you described with the changes in this pull request it works as expected.

Thank you a lot for this kind update.
I'll test it if I can find the time before release.


connect(_account->account()->pushNotifications(), &PushNotifications::notificationsChanged, this, &User::slotReceivedPushNotification, Qt::UniqueConnection);
connect(_account->account()->pushNotifications(), &PushNotifications::activitiesChanged, this, &User::slotReceivedPushActivity, Qt::UniqueConnection);
connect(_account->account()->pushNotifications(), &PushNotifications::fileIdsChanged, this, &User::slotReceivedPushFileChanges, Qt::UniqueConnection);
Copy link
Member

Choose a reason for hiding this comment

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

For compatibility with notify_push < 0.4.0 (April 2022, < Nextcloud 24) the signal without the file-ids should be connected as well.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Now the auto-merge already happened. I need to split of a new pull request.

i2h3 added 2 commits February 5, 2026 16:11
… in NextcloudKit.

Signed-off-by: Iva Horn <iva.horn@nextcloud.com>

# Conflicts:
#	shell_integration/MacOSX/NextcloudFileProviderKit/Sources/NextcloudFileProviderKit/Enumeration/RemoteChangeObserver.swift
Signed-off-by: Iva Horn <iva.horn@nextcloud.com>
@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 5, 2026

Quality Gate Failed Quality Gate failed

Failed conditions
1 Security Hotspot
11.1% Coverage on New Code (required ≥ 80%)
133 New Code Smells (required ≤ 0)
D Maintainability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@i2h3 i2h3 merged commit 24366ed into master Feb 5, 2026
21 of 22 checks passed
@i2h3 i2h3 deleted the i2h3/fix/remote-change-discovery branch February 5, 2026 17:23
@github-project-automation github-project-automation bot moved this from 🏗️ In progress to ☑️ Done in 💻 Desktop Clients team Feb 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: ☑️ Done

Development

Successfully merging this pull request may close these issues.

[Bug]: macOS VFS not updating folders and files

4 participants