Skip to content

Comments

Preserve dirty user data on domain removal#9436

Merged
i2h3 merged 1 commit intomasterfrom
i2h3/fix/9417-domain-removal-mode
Feb 10, 2026
Merged

Preserve dirty user data on domain removal#9436
i2h3 merged 1 commit intomasterfrom
i2h3/fix/9417-domain-removal-mode

Conversation

@i2h3
Copy link
Collaborator

@i2h3 i2h3 commented Feb 9, 2026

Summary: Closes #9417 because client-side data loss of unsynchronized items on file provider domain removal is prevented.

This also matches the behavior of iCloud Drive when it is disabled on a Mac.

In case of "dirty user data" a timestamped folder in ~/Library/CloudStorage will be created by macOS which contains all unsynchronized items. This avoids data loss on the client side when removing the file provider domain for a Nextcloud client account and does not conflict when the account possibly is set up anew.

The client reveals that folder on removal.

Also, this pull request disables the checkbox for the duration of setup or cleanup of a file provider domain, so race conditions and so on can be avoided by waiting for the transactions to complete.

@i2h3 i2h3 added this to the 33.0.0 milestone Feb 9, 2026
@i2h3 i2h3 self-assigned this Feb 9, 2026
Copilot AI review requested due to automatic review settings February 9, 2026 09:47
@i2h3 i2h3 added bug feature: 📁 file provider macOS File Provider Extension, more general also known as virtual file system. labels Feb 9, 2026
@github-project-automation github-project-automation bot moved this to 🧭 Planning evaluation (don't pick) in 💻 Desktop Clients team Feb 9, 2026
@i2h3 i2h3 moved this from 🧭 Planning evaluation (don't pick) to 🏗️ In progress in 💻 Desktop Clients team Feb 9, 2026
@i2h3 i2h3 enabled auto-merge February 9, 2026 09:54
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 PR addresses a macOS Virtual Files data-loss scenario by preserving “dirty” (locally modified but not yet uploaded) File Provider content when a File Provider domain is removed, and adds user-facing notification/diagnostics to reduce the chance of silent loss.

Changes:

  • Switch File Provider domain removal to preserve dirty user data and add a helper to locate the domain’s user-visible root URL.
  • Add XPC plumbing + extension implementation to detect whether the File Provider has dirty user data.
  • Add a new DirtyUserDataObserver plus Swift Testing coverage, and document testing conventions in AGENTS.md.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
src/gui/macOS/fileproviderxpc_mac.mm Adds synchronous XPC call to query dirty user data state.
src/gui/macOS/fileproviderxpc.h Exposes dirty-user-data query on the XPC wrapper.
src/gui/macOS/fileprovidersettingscontroller_mac.mm Warns users and opens Finder when dirty data is detected before domain removal.
src/gui/macOS/fileproviderdomainmanager.mm Uses preserve-dirty removal mode and adds user-visible URL lookup for a domain.
src/gui/macOS/fileproviderdomainmanager.h Declares userVisibleUrlForDomainIdentifier.
shell_integration/.../ClientCommunicationProtocol.h Extends XPC protocol with dirty-user-data query method.
shell_integration/.../FileProviderExtension+ClientCommunicationProtocol.swift Implements dirty-user-data check in the extension via materialized item enumeration.
shell_integration/.../DirtyUserDataObserver.swift Adds enumeration observer that detects unuploaded items.
shell_integration/.../DirtyUserDataObserverTests.swift Adds Swift Testing suite for the observer.
shell_integration/.../FileProviderItemMock.swift Adds a minimal mock item for observer tests.
AGENTS.md Adds Swift Testing conventions and guidance for mocks/tests.

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

@i2h3 i2h3 force-pushed the i2h3/fix/9417-domain-removal-mode branch from 3a71f89 to 617edca Compare February 9, 2026 14:07
@i2h3 i2h3 force-pushed the i2h3/fix/9417-domain-removal-mode branch from 617edca to 4107f3c Compare February 10, 2026 13:30
@github-actions
Copy link

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

Digest: sha256:fcbb3909f75e2a6bc240b04cfa2ce4d406d5b5ffaaf6d121ca480a44413d6bb8

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.

@sonarqubecloud
Copy link

@i2h3 i2h3 disabled auto-merge February 10, 2026 14:54
@i2h3 i2h3 merged commit 78b2b67 into master Feb 10, 2026
24 checks passed
@i2h3 i2h3 deleted the i2h3/fix/9417-domain-removal-mode branch February 10, 2026 14:55
@github-project-automation github-project-automation bot moved this from 🏗️ In progress to ☑️ Done in 💻 Desktop Clients team Feb 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug feature: 📁 file provider macOS File Provider Extension, more general also known as virtual file system.

Projects

Status: ☑️ Done

Development

Successfully merging this pull request may close these issues.

[Bug]: Nextcloud Desktop vfs working in local cache without warning, local files deleted when virtual files environment reset.

1 participant