Skip to content

Persistent access to security scoped synchronization folders#9438

Merged
i2h3 merged 1 commit intomasterfrom
i2h3/fix/classic-synchronization
Feb 10, 2026
Merged

Persistent access to security scoped synchronization folders#9438
i2h3 merged 1 commit intomasterfrom
i2h3/fix/classic-synchronization

Conversation

@i2h3
Copy link
Collaborator

@i2h3 i2h3 commented Feb 9, 2026

To retain access to security scoped locations on a device across sandboxed app launches, their access must be persisted using bookmarks.

Problem

After quitting and launching the client again it no longer could access synchronization folders in the file system.

Solution

Create bookmarks for those security scoped resources and persist them as part of the folder configuration.

@i2h3 i2h3 added this to the 33.0.0 milestone Feb 9, 2026
@i2h3 i2h3 self-assigned this Feb 9, 2026
@i2h3 i2h3 requested a review from Aiiaiiio as a code owner February 9, 2026 17:05
Copilot AI review requested due to automatic review settings February 9, 2026 17:05
@i2h3 i2h3 added the bug label Feb 9, 2026
@i2h3 i2h3 added os: 🍎 macOS Apple macOS, formerly also known as OS X 3. to review labels Feb 9, 2026
@i2h3 i2h3 added the feature: 📁 file provider macOS File Provider Extension, more general also known as virtual file system. label 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
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 adds persisted security-scoped bookmark handling on macOS so the client can regain access to user-selected sync folders across app restarts in a sandboxed environment.

Changes:

  • Persist per-folder app-scoped security-scoped bookmark data in settings and load it on startup.
  • Resolve bookmarks early during folder setup and keep the security-scoped access alive for the folder lifetime.
  • Split macOS sandbox helpers into dedicated types and enable the required macOS entitlement.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/gui/folderman.cpp Resolve persisted bookmarks before filesystem operations; attach access handle to Folder instances.
src/gui/folder.h Add securityScopedBookmarkData to FolderDefinition; add Folder API/storage for persistent access handle.
src/gui/folder.cpp Implement storing the persistent access handle; save/load bookmark data in settings.
src/common/utility_mac_sandbox.mm Add free function to create security-scoped bookmark data from a local path.
src/common/utility_mac_sandbox.h Expose bookmark-creation helper and include the new sandbox access types.
src/common/macsandboxsecurityscopedaccess.h/.mm Extract short-lived security-scoped access RAII wrapper into its own type.
src/common/macsandboxpersistentaccess.h/.mm Add long-lived bookmark resolution + access RAII wrapper for folder lifetime.
src/common/common.cmake Ensure new macOS sandbox sources are built on Apple platforms.
admin/osx/macosx.entitlements.cmake Enable app-scope bookmarks entitlement required for persisted bookmarks.
AGENTS.md Add guidance about splitting types into dedicated source files.

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

@i2h3 i2h3 force-pushed the i2h3/fix/classic-synchronization branch 2 times, most recently from 54c3659 to d1ddfd3 Compare February 10, 2026 13:13
@i2h3 i2h3 requested review from Rello and Copilot February 10, 2026 13:13
@i2h3 i2h3 enabled auto-merge February 10, 2026 13:21
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

Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.


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

Signed-off-by: Iva Horn <iva.horn@nextcloud.com>
@i2h3 i2h3 force-pushed the i2h3/fix/classic-synchronization branch from d1ddfd3 to 55d42d5 Compare February 10, 2026 13:24
@github-actions
Copy link

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

Digest: sha256:e96bb9cb85997213201be241c95ed096cca1cab35d39336177b57668077182c5

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

Quality Gate Failed Quality Gate failed

Failed conditions
50.0% Coverage on New Code (required ≥ 80%)
80 New Code Smells (required ≤ 0)
C 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 disabled auto-merge February 10, 2026 14:34
@i2h3 i2h3 merged commit 5421047 into master Feb 10, 2026
23 of 24 checks passed
@i2h3 i2h3 deleted the i2h3/fix/classic-synchronization branch February 10, 2026 14:34
@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

3. to review bug feature: 📁 file provider macOS File Provider Extension, more general also known as virtual file system. os: 🍎 macOS Apple macOS, formerly also known as OS X

Projects

Status: ☑️ Done

Development

Successfully merging this pull request may close these issues.

2 participants