Commit Graph

127 Commits

Author SHA1 Message Date
Iva Horn
d6db27ad78 fix(file-provider): Fix #8914 by omitting the faulty NSFileProviderRequest argument on enumerator request.
Signed-off-by: Iva Horn <iva.horn@nextcloud.com>
2025-10-23 15:32:29 +00:00
Iva Horn
7266c66b4e feat: Logging NSFileProviderRequest.
Signed-off-by: Iva Horn <iva.horn@nextcloud.com>
2025-10-20 10:22:18 +00:00
Jyrki Gadinger
90e610934e fix(file-provider): report a different error if database is not ready
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>
2025-10-15 15:45:58 +00:00
Iva Horn
dea70f985a fix(file-provider): Updated logging calls in extension implementation.
Signed-off-by: Iva Horn <iva.horn@icloud.com>
2025-10-13 10:20:22 +02:00
Iva Horn
57fbc2a271 feat: Improved logging of file provider extension implementation.
Signed-off-by: Iva Horn <iva.horn@icloud.com>
2025-10-01 11:56:54 +02:00
Iva Horn
6c5ee7c14a feat: Replaced Unified Logging System with Custom Solution.
- Removed explicit reference to NextcloudKit dependency which implicitly is pulled in already by NextcloudFileProviderKit.
- Consolidated some source code files into their respective view controllers in the file provider UI extension.

Signed-off-by: Iva Horn <iva.horn@icloud.com>
2025-09-24 13:23:28 +02:00
Iva Horn
6e2db6f08b feat: Configured NextcloudKit based on file provider domain identifier.
Signed-off-by: Iva Horn <iva.horn@icloud.com>
2025-09-17 08:15:44 +02:00
Iva Horn
0b2ead8243 feat: Implemented reauthentication in file provider UI extension (#8617).
Signed-off-by: Iva Horn <iva.horn@icloud.com>
2025-09-17 08:15:44 +02:00
Jyrki Gadinger
9711bbfdee fix(FileProviderExt): do not report syncing state when trying to delete trash items
Trying to delete items from the trash with the "Allow deletion of items
in Trash" setting unticked would previously result in the sync state
being stuck in the "Syncing" state.

Signed-off-by: Jyrki Gadinger <nilsding@nilsding.org>
2025-08-21 17:37:49 +02:00
Claudio Cambra
666a089d29 fix(shell_integration/macOS/FileProviderExt): Conform to changes in MaterialisedEnumerationObserver
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2025-06-17 09:11:59 +02:00
Claudio Cambra
866cbe3af9 fix(shell_integration/macOS/FileProviderExt): Remove fast enumeration use in enumerator
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2025-06-02 15:15:32 +02:00
Claudio Cambra
51df83bcdb feat(shell_integration/macOS/FileProviderExt): Adapt to async stored item fetching from NCFPK 2.1
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2025-05-28 08:52:47 +02:00
Claudio Cambra
ef180f88ee feat(shell_integration/macOS/FileProviderExt): Await ignored files before proceeding with create/modify/delete
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2025-05-15 12:10:44 +02:00
Claudio Cambra
cc4bc8fa98 feat(shell_integration/macOS/FileProviderExt): Pass ignored files matcher when creating/modifying/deleting items
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2025-05-15 12:10:44 +02:00
Claudio Cambra
f94ee2142f feat(shell_integration/macOS/FileProviderExt): Parse received ignored files to set up IgnoredFilesMatcher
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2025-05-15 12:10:44 +02:00
Claudio Cambra
c6254b57fb fix(shell_integration/macOS/FileProviderExt): Use NSError-based deletion rejected builder method
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2025-05-14 16:51:49 +02:00
Claudio Cambra
8a7fd5651b fix(shell_integration/macOS/FileProviderExt): Make item filename public during rejected deletion
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2025-05-14 16:51:49 +02:00
Claudio Cambra
aab2728a84 feat(shell_integration/macOS/FileProviderExt): Prevent deletion of trashed items when config flag is set
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2025-05-14 16:51:49 +02:00
Claudio Cambra
ef783d7b11 fix(shell_integration/macOS/FileProviderExt): Correctly build NSFileProviderErrors
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2025-05-09 17:40:41 +02:00
Claudio Cambra
52655ca9ce feat(shell_integration/macOS/FileProviderExt): Also use specific dbManager for local file handling
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2025-05-06 09:45:47 +02:00
Claudio Cambra
bc111b1e48 feat(shell_integration/macOS/FileProviderExt): Pass dbManager into standard FileProviderExtension methods
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2025-05-06 09:45:47 +02:00
Claudio Cambra
c75c4c46a3 feat(shell_integration/macOS/FileProviderExt): Configure specific instance of FilesDatabaseManager for account
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2025-05-06 09:45:47 +02:00
Andy Scherzinger
00994aa9e8
docs(reuse): Migrate to SPDX header
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
2025-04-16 15:19:26 +02:00
Claudio Cambra
ee3ae980a8 shell_integration/macOS/FileProviderExt: Do not report enumeration-related sync state
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2025-03-28 10:50:33 +01:00
Claudio Cambra
11137e572d shell_integration/macOS/FileProviderExt: Do not delete an item twice in FileProviderExtension
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2025-02-06 12:24:09 +01:00
Claudio Cambra
a08a425083 shell_integration/macOS/FileProviderExt: Adapt to API changes in NextcloudFileProviderKit changes in 2.0
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2025-02-06 12:24:09 +01:00
Claudio Cambra
4012d43bb9 Do not provide items if account is not set up correctly
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2024-09-12 09:50:50 +02:00
Claudio Cambra
1283284572 Remove ncAccount usages removed in NCFPK API
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2024-07-29 16:52:37 +08:00
Claudio Cambra
92f42bc16d
Lock and unlock when accessing sync actions in FileProviderExt to protect against possible races
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2024-07-23 14:06:29 +08:00
Claudio Cambra
939d67bfcc
Set self as listener for Enumerator in FileProviderExt
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2024-07-23 14:06:29 +08:00
Claudio Cambra
617ca1a153
Add conformance to NextcloudFileProviderKit's EnumerationListener protocol in FileProviderExt
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2024-07-23 14:06:28 +08:00
Claudio Cambra
0c78594481
Track sync actions in main FileProviderExt procedures
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2024-07-23 14:06:28 +08:00
Claudio Cambra
3f3f478f6a
Add method to remove finished sync action in FileProviderExt
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2024-07-23 14:06:28 +08:00
Claudio Cambra
c189f2952f
Add method to mark action as error sync action in FileProviderExt
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2024-07-23 14:06:28 +08:00
Claudio Cambra
3e6b20713e
Add method to insert new sync action in FileProviderExt
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2024-07-23 14:06:28 +08:00
Claudio Cambra
5237822221
Add sets for actions, to be able to track multiple actions
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2024-07-23 14:06:28 +08:00
Claudio Cambra
e7a164d312 Remove unused urlsession stuff in FileProviderExtension
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2024-07-19 16:24:21 +08:00
Claudio Cambra
73fde5065d Adapt to remoteInterface changes in NCFPK
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2024-07-19 16:24:21 +08:00
Claudio Cambra
68370ade88
Add change observer from NCFPK
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2024-04-17 16:15:05 +08:00
Claudio Cambra
6a64248ff6
Always signal enumerator after errors to try and recover from what the error might have been
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2024-04-17 16:15:04 +08:00
Claudio Cambra
33e2c084a5
Provide NCFPK enumerator with extension domain
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2024-04-17 16:15:04 +08:00
Claudio Cambra
c082c446c1
Fix passing of wrong item into item.modify
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2024-04-17 16:15:04 +08:00
Claudio Cambra
dab28f20f4
Improve logging in delete item procedure of FPExt
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2024-04-17 16:15:04 +08:00
Claudio Cambra
485b07a805
Use NCFPK item modify method
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2024-04-17 16:15:03 +08:00
Claudio Cambra
c9a131736a
Use NCFPK Item.create in createItem
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2024-04-17 16:15:03 +08:00
Claudio Cambra
2373cd4dde
Use fetchContents from NCFPK item
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2024-04-17 16:15:03 +08:00
Claudio Cambra
3ec18ba1a6
Simplify FileProviderExtension's deleteItem method by leveraging Item's delete method
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2024-04-17 16:15:03 +08:00
Claudio Cambra
788fd7f363
Greatly simplify item method of FIleProviderExtension by using item storedItem method
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2024-04-17 16:15:03 +08:00
Claudio Cambra
6200cab957
Use new convenience method to get Item for root container from NCFPK
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2024-04-17 16:15:03 +08:00
Claudio Cambra
e8d1afa3df
Adapt to new NextcloudFileProviderKit item nomenclature
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2024-04-17 16:15:02 +08:00