Commit graph

181 commits

Author SHA1 Message Date
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