Skip to content

fix: allow moving Nextcloud folders in Apple Files - #4505

Open
zxxwyt wants to merge 1 commit into
nextcloud:masterfrom
zxxwyt:nc-ios/4253-folder-move
Open

zxxwyt wants to merge 1 commit into
nextcloud:masterfrom
zxxwyt:nc-ios/4253-folder-move

Conversation

@zxxwyt

@zxxwyt zxxwyt commented Nov 29, 2026

Copy link
Copy Markdown
Contributor

Closes #4253

In Apple Files, long-pressing a writable Nextcloud folder offered Copy but omitted Move. The file provider now advertises Move for unlocked, non-root folders when the server grants move permission. After a move succeeds, it updates the folder and its descendants in one Realm transaction. Their identifiers and offline flags are preserved. A move to an occupied path leaves the destination intact.

Verification

I also tested moving a folder in Apple Files against a live Nextcloud instance and confirmed that I could open the file inside after the move.

  • Apple Files. On an iPhone 17 simulator (iOS 26.0.1) connected to Nextcloud Server 32.0.15, Codex reproduced the missing action on the previous build. With this change, Codex moved Trip into Archive and opened Archive/Trip/Day-1/inside.txt in Quick Look. It displayed “Moved folder contents”.
  • Server readback. WebDAV returned 404 for the old path. The nested file at the new path and the file in the sibling folder Trip-2 both retained their original bytes. A separate WebDAV check returned 412 when the destination name was occupied.
  • Regression tests. Codex ran NCFileProviderMoveTests in Xcode. Both test methods passed, including both destination names in the parameterized test (three executions).
  • Sanitizer observation. On a rerun the tests passed, then Thread Sanitizer reported a race between an asynchronous Realm read and destruction of Realm global state as the test host exited. Running only the existing NCBackupExclusionTests on the same simulator produced the same warning.

The local build resolved GoogleAppMeasurement 13.2.0 and GoogleAdsOnDeviceConversion 3.8.0 to satisfy Firebase 13.2.0.

🤖 AI (if applicable)

  • The content of this PR was partly or fully generated using AI (Codex:gpt-6.2-astra).

Codex helped implement the file provider and Realm changes, wrote regression tests, ran the checks above and drafted this description.

Files hides Move unless the provider advertises reparenting. A directory move must retain stable identifiers and offline descendants, and a colliding destination must survive the operation.

Assisted-by: Codex:gpt-6.2-astra
Signed-off-by: zouxianxian <187847046+zxxwyt@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Files app: Move folder is not possible

1 participant