Commit graph

330 commits

Author SHA1 Message Date
Claudio Cambra
2853b88258
Move NKFile to metadata conversion methods to a new extension for NextcloudItemMetadataTable, where they are better placed
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 16:02:37 +08:00
Claudio Cambra
6169594864
Prevent multi-thread modification of the same array with serial array modification dispatch queue when enumerating items in FileProviderEnumerator
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 16:02:37 +08:00
Claudio Cambra
9c1a035e3c
Reintegrate sync engine into FileProviderEnumerator class
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 16:02:37 +08:00
Claudio Cambra
bd50f753fa
Simplify initial item enumeration, no need to fetch from database in FileProviderEnumerator
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 16:02:37 +08:00
Claudio Cambra
fe7ca12d9c
Perform slow metadata to FileProviderItem conversion concurrently in FileProviderEnumerator
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 16:02:36 +08:00
Claudio Cambra
808f976ae9
Fix children serverurl rename in file provider nc files database
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 16:02:36 +08:00
Claudio Cambra
384093cbc6
Remove redundant double read of serverUrl when often we always want to do a depth 1 read in NextcloudSyncEngine
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 16:02:36 +08:00
Claudio Cambra
27a177ab35
Make sure to include new metadatas in folders to scan for changes in recursive scan of NextcloudSyncEngine
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 16:02:36 +08:00
Claudio Cambra
34a43fea69
Make sure to notify when folder moved in FileProviderExtension
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:29:57 +08:00
Claudio Cambra
9fadc89ff0
Fix unsetting of etags on directories (and only) directories on update
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:29:57 +08:00
Claudio Cambra
02e1d6a47f
Fix recursive directory metadata renaming order
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:29:57 +08:00
Claudio Cambra
9cc05457c0
Do not do specific enumeration of items working set in FileProviderEnumerator
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:29:57 +08:00
Claudio Cambra
289f7f2c9f
Ensure we do not set etag if we have set updateDirectoryEtags to false in NextcloudFilesDatabaseManager updateItemMetadatas
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:29:57 +08:00
Claudio Cambra
35570a3160
Move remote sync functionality out of enumerator and into separate NextcloudSyncEngine class
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:29:56 +08:00
Claudio Cambra
1524fc01f0
Progressively enumerate items as we get them for working set
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:29:56 +08:00
Claudio Cambra
5154a57ac6
Move conversion from NSData to NSFileProviderPage to separate func
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:29:56 +08:00
Claudio Cambra
6202f3d70a
Split metadata parsing to complete enumerator into own function
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:29:56 +08:00
Claudio Cambra
8c729fb2f9
Simplify enumerateItems of working set by using fullRecursiveScan in FileProviderEnumerator
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:29:56 +08:00
Claudio Cambra
b369b5d515
Handle invalidation of enumerator during long recursive scans in FileProviderEnumerator
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:29:56 +08:00
Claudio Cambra
213893b13f
Fix recursive scan when scanChangesOnly is false in FileProviderEnumerator
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:29:56 +08:00
Claudio Cambra
d0b4b6853c
Move deleted/updated conflict check to fullRecursiveScan in FileProviderEnumerator+RemoteSync
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:29:56 +08:00
Claudio Cambra
3c2c360a2e
Properly report and handle critical errors during recursive enumeration in FileProviderEnumerator
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:29:56 +08:00
Claudio Cambra
245129de99
Move remote sync stuff in FileProviderEnumerator to own file
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:29:55 +08:00
Claudio Cambra
b2d2f9586e
Properly report deleted metadatas in recursive directory delete in FileProviderEnumerator
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:29:55 +08:00
Claudio Cambra
a779fe76cb
Favour straight return in updateItemMetadatas rather than unnecessary completionHandler in NextcloudFilesDatabaseManager
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:29:55 +08:00
Claudio Cambra
0526079504
Fix renaming directories remotely fixing local sync state in file provider
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:29:55 +08:00
Claudio Cambra
29b495335b
Do not update etags for child folders acquired in a depth 1 readServerUrl in FileProviderEnumerator
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:29:55 +08:00
Claudio Cambra
872186248a
Remove redundant directory metadata tables in File Provider
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:29:55 +08:00
Claudio Cambra
2e70c82663
Prevent premature running of completion handler when modifying folder in FileProviderExtension
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:29:55 +08:00
Claudio Cambra
3538ce9424
Change fullRecursiveScan function to enable more than just look for changes, also do proper full scan
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:29:55 +08:00
Claudio Cambra
97d2b354df
Ensure we are not marking items as both updated and deleted in FileProviderEnumerator
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:29:55 +08:00
Claudio Cambra
2c64e4b6bd
Ensure xcodebuild uses the Info.plist file verbatim
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:29:54 +08:00
Claudio Cambra
0bdbc956bc
Fix FileProviderExt bundle identifier
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:29:54 +08:00
Claudio Cambra
d3c3181c0d
Ensure we are logging error description itself and not NKError wrapper or any Error type
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:29:53 +08:00
Claudio Cambra
4f1f4388af
Rewrite modifyItem to make it non-blocking on the main thread in FileProviderExtension
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:29:53 +08:00
Claudio Cambra
ccad81949a
Make enumeration of working set changes non-blocking in FileProviderEnumerator
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:28:46 +08:00
Claudio Cambra
60005d89bc
Ensure we are editing realm database on main thread in FileProviderEnumerator
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:28:46 +08:00
Claudio Cambra
52fe107ec5
Fix blocking main thread when enumerating working set items in FileProviderEnumerator
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:28:46 +08:00
Claudio Cambra
073db8182b
Log errors in fetching local temporary file provider path
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:28:46 +08:00
Claudio Cambra
762aee8e41
Simplify temp local file creation while fetching contents, use File Provider volume
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:28:46 +08:00
Claudio Cambra
8661841c44
Remove unnecessary local file operations in FileProviderExt
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:28:46 +08:00
Claudio Cambra
221848f230
Properly set cancellation, pausing, and resuming handlers on FileProviderExtension task progress
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:28:46 +08:00
Claudio Cambra
607d72615d
Add ability to set handlers from AlamoFire request on Progress extension
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:28:46 +08:00
Claudio Cambra
d4d5c8f8da
Removed unused tracking of outstanding session and ocID related tasks
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:28:45 +08:00
Claudio Cambra
a7616502ae
Do not copy pause, cancel, and resuming handlers in Progress extension copyCurrentStateToProgress by default
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:28:45 +08:00
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
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