Skip to content

fix: restore Nextcloud favorites when Apple Files reopens - #4506

Open
zxxwyt wants to merge 1 commit into
nextcloud:masterfrom
zxxwyt:nc-ios/4410-files-favorites
Open

zxxwyt wants to merge 1 commit into
nextcloud:masterfrom
zxxwyt:nc-ios/4410-files-favorites

Conversation

@zxxwyt

@zxxwyt zxxwyt commented Nov 29, 2026

Copy link
Copy Markdown
Contributor

Closes #4410

Nextcloud folders could disappear from Favorites after Apple Files restarted. Files can request its working set before anyone opens a folder. At that point the provider could lack an account session, and the favorite ranks it held in memory were lost on restart.

The provider now opens the session for the requested domain and reads its favorite folders from Realm. It persists the order Files assigns per account and includes server favorites that Files has yet to rank. When the provider restarts, it expires the previous working-set anchor so Files can reload the list.

Verification

I also tested Favorites in Apple Files against a live Nextcloud instance and confirmed that the favorites remained available after reopening Files.

  • Apple Files. On an iPhone 17 simulator (iOS 26.0.1) connected to Nextcloud Server 32.0.15, Codex favorited First/Nested and Second and dragged Nested to the top. After terminating and relaunching Files, both folders opened from Favorites in the saved order. After removing Second and relaunching again, only Nested remained. WebDAV confirmed favorite values of 1 and 0 respectively.
  • Regression tests. Codex ran FileProviderFavoriteRanksTests and FileProviderWorkingSetChangesTests on an iPad Pro 13-inch (M5) simulator with iPadOS 26.0.1 and Xcode 27.2. All five tests passed with zero skips.

On a further relaunch, Files opened in On My iPhone. Before browsing the Nextcloud location, Codex returned to Browse and opened the existing Nested favorite directly. The removed Second entry was absent.

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 working-set and favorite-rank changes, wrote regression tests, ran the checks above and drafted this description.

Files can request its working set before browsing a folder. Establish the domain session on that path, persist the order assigned by Files, and let an expired working-set anchor reload favorites from Realm after the provider restarts.

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.

Nextcloud folders disappear from Apple Files Favorites after restarting the app

1 participant