fix(file-provider): report a different error if database is not ready#8885
Merged
nilsding merged 1 commit intoOct 15, 2025
Merged
Conversation
As per [the docs for `NSFileProviderReplicatedExtension item(for:request:completionHandler:)`][1], the system will automatically retry calling the method if the error is not one of `.notAuthenticated`, `.serverUnreachable`, or `.noSuchItem`. From my observations it seems that if the error `.cannotSynchronize` is returned for the root container (i.e. `NSFileProviderRootContainerItemIdentifier`), the system/file provider framework just ends up deleting the newly created sync directory inside `~/Library/CloudStorage`. This broke the entry in the Finder sidebar. After changing the error to `.notAuthenticated` (which is semantically wrong, but alas), I now could disable/enable the File Provider as often as I wanted without the Finder sidebar entry to ever break due to the directory having been removed previously ... Strange, this. [1]: https://developer.apple.com/documentation/fileprovider/nsfileproviderreplicatedextension/item(for:request:completionhandler:)#Discussion Signed-off-by: Jyrki Gadinger <nilsding@nilsding.org>
Member
Author
|
/backport to stable-4.0 |
Rello
approved these changes
Oct 15, 2025
Contributor
|
Artifact containing the AppImage: nextcloud-appimage-pr-8885.zip Digest: 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. |
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.




As per the docs for
NSFileProviderReplicatedExtension item(for:request:completionHandler:), the system will automatically retry calling the method if the error is not one of.notAuthenticated,.serverUnreachable, or.noSuchItem.From my observations it seems that if the error
.cannotSynchronizeis returned for the root container (i.e.NSFileProviderRootContainerItemIdentifier), the system/file provider framework just ends up deleting the newly created sync directory inside~/Library/CloudStorage. This broke the entry in the Finder sidebar.After changing the error to
.notAuthenticated(which is semantically wrong, but alas), I now could disable/enable the File Provider as often as I wanted without the Finder sidebar entry to ever break due to the directory having been removed previously ... Strange, this.I discovered this by comparing the logs when setting up the File Provider for the same account. The logs of such a failed invocation contained the following message, whereas successful ones did not: