Commit graph

681 commits

Author SHA1 Message Date
Claudio Cambra
5e8d7217a9
Warn when retrieved size of file upload is different to the expected size in FileProviderExtension
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:28:45 +08:00
Claudio Cambra
b8224212ca
Ensure item upload/download states are properly set and reset in FileProviderExtension
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:28:45 +08:00
Claudio Cambra
23e623ef0a
Make it possible to disable building file provider module
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:28:45 +08:00
Claudio Cambra
f16f89118e
Set deployment target for FileProviderExt to macOS 11.0
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:35 +08:00
Claudio Cambra
4e536dcd65
Ensure upload errors for modified files are recorded in FileProviderExtension
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:35 +08:00
Claudio Cambra
f4be264eee
Ensure existing metadatas being uploaded are set to uploading status in FileProviderExtension
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:35 +08:00
Claudio Cambra
9083f982d9
Use completion handler to retrieve updated metadata after status change, fixing race condition in FileProviderDatabaseManager
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:35 +08:00
Claudio Cambra
7967ced04e
Properly handle logging interpolation in NextcloudFilesDatabaseManager
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:35 +08:00
Claudio Cambra
c88fb7fb3e
Do not hide interpolated log strings in FileProviderSocketLineProcessor
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:35 +08:00
Claudio Cambra
5ae1936328
Handle different interpolated string types differently in FileProviderExtension logging
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:35 +08:00
Claudio Cambra
89164d99ec
Make privacy level of interpolated strings in FileProviderEnumerator logging more granular
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:35 +08:00
Claudio Cambra
3082850e68
Ensure errors are always publicly displayed in unified logging of File Provider
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:34 +08:00
Claudio Cambra
545fe6d56e
Finish replacing NSLog with use of Logger in LocalFilesUtils
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:34 +08:00
Claudio Cambra
810c7d0b19
Also use logger in FileProviderSocketLineProcessor
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:34 +08:00
Claudio Cambra
854b11e477
Use Logger materialisedFileHandling for logging in FileProviderMaterialisedEnumerationObserver
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:34 +08:00
Claudio Cambra
5c72c6a2e9
Replace NSLog in FileProviderExtension with use of Logger
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:34 +08:00
Claudio Cambra
75f18b8bd5
Use enumeration category and logger for FileProviderEnumerator
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:34 +08:00
Claudio Cambra
b16bf24949
Improve logging in files database manager with use of Logger
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:34 +08:00
Claudio Cambra
0f6ceef06f
Add a logger extensions to use system unified logging in File Provider components
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:34 +08:00
Claudio Cambra
8994f31cb9
Remove unnecessary full reimport after initial account configuration in FileProviderExtension
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:33 +08:00
Claudio Cambra
7863ba8594
Improve error handling in fetchContents if path is not available FileProviderExtension
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:33 +08:00
Claudio Cambra
68044891f0
Properly respond to errors in working set enumerateItems in FileProviderEnumerator
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:33 +08:00
Claudio Cambra
287c98f7f5
Add directoryMetadataLogString convenience method for logging in NextcloudFilesDatabaseManager
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:33 +08:00
Claudio Cambra
134e373f1b
Do not delete "no longer existing files" when doing enumeration of items in FileProviderEnumerator
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:33 +08:00
Claudio Cambra
b532b96937
Add helper itemMetadataLogString static func for logging in NextcloudFilesDatabaseManager
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:33 +08:00
Claudio Cambra
2ca2609e0c
Properly write item metadata status update to database in NextcloudFilesDatabaseManager
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:33 +08:00
Claudio Cambra
412fd0887e
Provide file provider errors in FileProviderExtension methods
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:31 +08:00
Claudio Cambra
b9b408d606
Fix general error handling in FileProviderEnumerator
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:31 +08:00
Claudio Cambra
3873ad126d
Use NKError extension properties instead of magic numbers in FileProviderEnumerator
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:31 +08:00
Claudio Cambra
1ee6d1a1cc
Improve handling of no changes return in readFileOrFolder throughout FileProviderEnumerator
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:31 +08:00
Claudio Cambra
6ffbb5abf6
Properly handle stopping when finding matching etags in readServerUrl of FileProviderEnumerator
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:31 +08:00
Claudio Cambra
d639baeea0
Add no changes error code in NKError extension
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:31 +08:00
Claudio Cambra
a0c819fdbe
Make NKError extension conversion more legible
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:30 +08:00
Claudio Cambra
109258f3ce
Use NKError extension method in FileProviderEnumerator enumerate methods
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:30 +08:00
Claudio Cambra
fdaf0d5aa5
Add NKError extension to make conversion to FileProviderError easier
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:30 +08:00
Claudio Cambra
6ef4f8a4f4
Implement better error handling in enumerator changes
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:30 +08:00
Claudio Cambra
d1008df429
Respond to materializedItemsDidChange in FileProviderExtension
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:30 +08:00
Claudio Cambra
20363bd241
Add completion handler to materialised observer
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:30 +08:00
Claudio Cambra
61890ddd72
Added FileProviderMaterialisedEnumerationObserver to handle clean up operations after materialisation changes
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:30 +08:00
Claudio Cambra
52f5b6a524
Split up the huge NextcloudFilesDatabaseTables file into separate files for each table schema
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:30 +08:00
Claudio Cambra
32e5dbad4a
Rename misleading FileProviderFilesUtils to LocalFilesUtils
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:29 +08:00
Claudio Cambra
c24ed9b7ac
Remove isFileSynced function which does not work as intended
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:29 +08:00
Claudio Cambra
1d1578447e
Move parentItemIdentifierMetadata helper method to the database manager
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:29 +08:00
Claudio Cambra
3ec9968fc2
Move file provider database files into own folder
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:29 +08:00
Claudio Cambra
287a4e4c0b
Unauthenticate the file provider extension when account is logged out
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:29 +08:00
Claudio Cambra
c593bd8a50
Fix variable related warnings in FileProvider
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:27 +08:00
Claudio Cambra
c4d3c4ba88
Improve reliability of modifyItem in FileProviderExtension
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:27 +08:00
Claudio Cambra
882e58aa64
Don't compare un-persisted properties of NextcloudItemMetadataTable in isInSameRemoteState, fixing constant updating of metadatas
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:27 +08:00
Claudio Cambra
1cc0cf7129
Fix compatibility with latest NextloudKit version TypeClassFile in NKCommon
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:27 +08:00
Claudio Cambra
81fb05298c
Be efficient in working set enumeration by only enumerating for new items or changes folders that have been explored already
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:26 +08:00
Claudio Cambra
79d89c21c7
Ensure no metadatas get deleted when updating metadata for scanned directory in FileProviderEnumerator
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:26 +08:00
Claudio Cambra
d3f2094866
Remove workarounds no longer needed for Realm thread crashing
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:25 +08:00
Claudio Cambra
17fea88450
Replace full depth scanning of changes on every enumerate changes request with smarter recursive algorithm
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:25 +08:00
Claudio Cambra
1a48e4e06e
Fix root cause of threading issues with metadata updates
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:25 +08:00
Claudio Cambra
7c8aab38d2
Fix erroneous deletion of metadata when updating serverUrl subject directory
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:25 +08:00
Claudio Cambra
2ac3a22523
Further improve/cleanup/simplify file provider extension init
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:25 +08:00
Claudio Cambra
3e269a958b
Fix crash on thread clash with Realm when enumerating changes
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:25 +08:00
Claudio Cambra
147e06c40a
Fix return of updated and deleted metadatas in database manager
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:25 +08:00
Claudio Cambra
f427750f2c
Ensure metadata handled in FileProviderItem is copy, preventing crashing due to accessing live table from different thread
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:24 +08:00
Claudio Cambra
24d6c5071c
Create sortedDirectoryMetadatas convenience method in database manager
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:24 +08:00
Claudio Cambra
64e32b48eb
Add convenience method to get child directories from database manager
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:24 +08:00
Claudio Cambra
65ab13c0f9
Ensure we don't saturate the server with propfind requests
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:24 +08:00
Claudio Cambra
390403ef5e
Properly report pagination for working set enumeration
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:24 +08:00
Claudio Cambra
b52b82134e
Enumerate all known folders as workingSet enumeration
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:24 +08:00
Claudio Cambra
7302c953d8
Rewrite working set handling to make it match the server remote, per Apple recommendation
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:24 +08:00
Claudio Cambra
32e81a693e
Add method to get all item metadatas in database manager
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:24 +08:00
Claudio Cambra
24b328f57b
Add method to get all directory metadatas in database manager
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:24 +08:00
Claudio Cambra
b73c1d72fb
Better handle initial set up of the file provider extension
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:23 +08:00
Claudio Cambra
03c1731fb5
Handle 404 errors from readFileOrFolder as special deletion case in FileProviderEnumerator
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:23 +08:00
Claudio Cambra
25a09e1704
Use ocIds for directory metadata deletion, prevent deletion if no such directory found in NextcloudFilesDatabaseManager
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:23 +08:00
Claudio Cambra
65ed3ad846
Use ocIds for item metadata deletion in NextcloudFilesDatabaseManager
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:23 +08:00
Claudio Cambra
2b92e9b546
Improve handling of nil values in CompleteChangesObserver
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:23 +08:00
Claudio Cambra
47d50af140
Enumerate changed in the working set
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:23 +08:00
Claudio Cambra
1ffdc5f1c5
Refactor change enumeration completion into separate static function
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:23 +08:00
Claudio Cambra
e2943ab043
Delete new updated items that are now E2EE
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:23 +08:00
Claudio Cambra
2cf4033f9b
Enumerate changes for normal serverUrls in FileProviderEnumerator
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:22 +08:00
Claudio Cambra
53649c2933
Rename completeObserver to completeEnumerationObserver
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:22 +08:00
Claudio Cambra
60dbf167b9
Fix the serverUrl used to fetch database item metadatas on enumerateItems
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:22 +08:00
Claudio Cambra
7734316416
Fix accidental purge of all metadatas caused by trying to call updateDirectoryMetadatasFromItemMetadatas when reading the root container
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:22 +08:00
Claudio Cambra
d478320dd3
Refactor readFileOrFolder to be more adaptible to enumerating items or changes
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:22 +08:00
Claudio Cambra
61dd51ae02
Properly delete directory and all children when updating folder metadatas in database manager
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:22 +08:00
Claudio Cambra
e7e850094b
Also report all new, updated, and deleted metadatas from updateItemMetadatas in NextcloudFilesDatabaseManager
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:22 +08:00
Claudio Cambra
a10b563eb7
Report new item metadatas and updated item metadatas in processItemMetadatasToUpdate in NextcloudFilesDatabaseManager
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:22 +08:00
Claudio Cambra
fc376b5fe6
Report deletedItemMetadatas in processItemMetadatasToDelete in NextcloudFilesDatabaseManager
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:21 +08:00
Claudio Cambra
76311cc66f
Properly handle readFileOrFolder of file vs folder
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:21 +08:00
Claudio Cambra
cc72cc361c
Keep track of additional details about enumerating item in the FileProviderEnumerator
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:21 +08:00
Claudio Cambra
d22b8e0eb7
Enumerate materialised items when system requests working set
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:21 +08:00
Claudio Cambra
3316d19b90
Add convenience method to get local file metadatas for an account in NextcloudItemMetadataTable form in NextcloudFilesDatabaseManager
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:21 +08:00
Claudio Cambra
a18c6dc258
Add convenience method to get all local file metadatas for an account in NextcloudFilesDatabaseManager
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:21 +08:00
Claudio Cambra
17f52982bd
Properly report progress for download and upload operations in FileProviderExtension
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:21 +08:00
Claudio Cambra
628ff92dec
Add a Progress extension with convenience methods for copying progress data from one progress object to another
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:21 +08:00
Claudio Cambra
53d2fc0c1e
Prevent creation of symbolic link items in FileProviderExtension
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:21 +08:00
Claudio Cambra
ca298eff87
Handle version item requests in fetchContents of FileProviderExtension per the documentation
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:20 +08:00
Claudio Cambra
54587e8c07
Clarify current use of sync anchor in FileProviderEnumerator
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:20 +08:00
Claudio Cambra
06b59b6756
Correctly fulfill delete item requests on server
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:20 +08:00
Claudio Cambra
3e0a9e9912
Support reparenting file provider items correctly
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:20 +08:00
Claudio Cambra
a146b65f76
Properly handle several modify item fields at once in FileProviderExtension
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:20 +08:00
Claudio Cambra
020c5d5104
Only try upload of modified item in FileProviderExtension if that had its contents changed and we have a valid content url
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:20 +08:00
Claudio Cambra
0f2fbf7518
Handle renaming of both files and folders correctly in FileProviderExtension
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:20 +08:00
Claudio Cambra
c7660b50df
Add convenience method to rename file item metadatas in database
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:20 +08:00
Claudio Cambra
5f24527270
Properly handle renaming folders in FileProviderExtension modifyItem
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:19 +08:00
Claudio Cambra
c3f79eecc6
Add methods to rename directory metadata and propagate modifications to all children in NextcloudFilesDatabaseManager
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:19 +08:00
Claudio Cambra
47d98a44a8
Add methods to delete metadata types in NextcloudFilesDatabaseManager
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:19 +08:00
Claudio Cambra
c6cc87a4b8
Extension can now upload modifications to items on the server
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:19 +08:00
Claudio Cambra
992ef7b62b
Add ability for extension to create items correctly on the server
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:19 +08:00
Claudio Cambra
7d2c21c772
Don't unnecessarily fetch item metadata when fetching contents
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:19 +08:00
Claudio Cambra
81dd5966f8
Unprivate direcotryMetadataFromItemMetadata in database manager
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:19 +08:00
Claudio Cambra
dc2e14d57b
Add convenience method to add directory metadata to database
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:19 +08:00
Claudio Cambra
91ad815a6b
Add working file content fetching
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:18 +08:00
Claudio Cambra
b70e9d11bb
Add convenience method to add local file metadata from item metadata to database
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:18 +08:00
Claudio Cambra
293512560e
Add convenience method to add item metadata status
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:18 +08:00
Claudio Cambra
90d5c8f54e
Add convenience method to update item metadata status
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:18 +08:00
Claudio Cambra
3342fb77c8
Add convenience properties to NextcloudItemMetadataTable
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:18 +08:00
Claudio Cambra
230b55d7e9
Stop using NextcloudKit.shared and NKCommon.shared, use specific NextcloudKit instance instead to prevent clashing between different FileProvider domains
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:18 +08:00
Claudio Cambra
f0524d44e1
Switch to NCKit work/unsharedify-nckit branch
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:18 +08:00
Claudio Cambra
98afd95e59
Fix Realm crashes when trying to delete certain objects
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:18 +08:00
Claudio Cambra
6a258c0c37
Properly handle errors when trying to read server url in FileProviderEnumerator
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:18 +08:00
Claudio Cambra
3be08bb15e
Fix scanning of child directories in FileProviderEnumerator
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:17 +08:00
Claudio Cambra
476d6a2456
Don't unnecessarily fail to get serverUrl for enumerated item in FileProviderEnumerator when this can be acquired straight from the itemMetadata
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:17 +08:00
Claudio Cambra
c4580183e7
Only reimport entire file provider domain if there have been no recorded files when ncAccount is configured
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:17 +08:00
Claudio Cambra
9c18d36f41
Add convenience method to check if any file metadatas have been stored for account in NextcloudFilesDatabaseManager
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:17 +08:00
Claudio Cambra
74222daa2a
Don't unnecessarily fail to provide parentItemIdentifier in NextcloudFileProviderFilesUtils when we can get the root container straight from the item metadata in question
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:17 +08:00
Claudio Cambra
5c01109004
Switch to develop branch of NextcloudKit
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:16 +08:00
Claudio Cambra
06f2714a95
Improve and fix enumerator signalling after initial account setup in FileProviderExtension
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:16 +08:00
Claudio Cambra
ff25f940ec
Fix URL path composition for utility methods in NextcloudFileProviderFilesUtils
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:16 +08:00
Claudio Cambra
ceb9aa3b65
Fix try/catch indentation in NextcloudFileDatabaseManager
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:16 +08:00
Claudio Cambra
7cb49393fe
Fix NextcloudItemMetadataTable status query type
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:16 +08:00
Claudio Cambra
38d1b95bd2
Fix the webDavUrl for NextcloudAccount
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:16 +08:00
Claudio Cambra
2f5d0e6fe9
Set up NextcloudKit account in FileProviderExtension
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:16 +08:00
Claudio Cambra
325878b696
Improve logging in FileProviderEnumerator
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:16 +08:00
Claudio Cambra
67de82913e
Keep track of requested enumerators when account is being configured, notify them as changed once account is set up
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:15 +08:00
Claudio Cambra
ba86824c7e
Improve FileProvider logging
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:15 +08:00
Claudio Cambra
31732c2fb2
Added missing network entitlement to FileProviderExt
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:15 +08:00
Claudio Cambra
a046eca3c3
Use safer separator for account details socket message
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:15 +08:00
Claudio Cambra
f01b6a545f
Fix path handling for file provider database setup
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:15 +08:00
Claudio Cambra
e7e985f355
Correctly register object schemas in Realm database
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:15 +08:00
Claudio Cambra
1cb7da9bac
Send account details over socket and simplify NextcloudAccount members, turn all to Strings
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:15 +08:00
Claudio Cambra
81b5c33571
Complete item method of FileProviderExtension
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:15 +08:00
Claudio Cambra
d801bfc8f5
Complete basic barebones enumeration
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:15 +08:00
Claudio Cambra
5f0a4883fc
Use NSLog instead of print in FileProvider
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:14 +08:00
Claudio Cambra
176303dcf1
Use more modern Realm @Persisted
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:14 +08:00
Claudio Cambra
d0ac36faab
Make record updating methods safer by checking for existing metadatas internally
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:14 +08:00
Claudio Cambra
57d585201e
Add method to get directory tables from database in manager
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:14 +08:00
Claudio Cambra
7ff2379e3d
Make sure to create copies of Realm objects to prevent issues with live-fire objects
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:14 +08:00
Claudio Cambra
496b94a9a7
Add comparison helper to NextcloudDirectoryMetadataTable
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:14 +08:00
Claudio Cambra
c4014e8b6a
Add parent directory server url data to directory table
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:14 +08:00
Claudio Cambra
d9e368cbe7
Refactor updateDirectoryMetadatas in the database manager
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:14 +08:00
Claudio Cambra
3354f3e4de
Add updateDirectoryMetadatasFromItemMetadatas to NextcloudFilesDatabaseManager
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:13 +08:00
Claudio Cambra
316ef61d83
Split off update and creation process of updateItemMetadatas of NextcloudFilesDatabaseManager to private method
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:13 +08:00
Claudio Cambra
4d2da1037d
Split off deletion process of updateItemMetadatas of NextcloudFilesDatabaseManager to private method
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:13 +08:00