Commit graph

344 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
Ivan Sein
9bcc017fb8
Only set CODE_SIGN_INJECT_BASE_ENTITLEMENTS=NO in FileProviderExt for release configuration.
Signed-off-by: Ivan Sein <ivan@nextcloud.com>
2023-05-12 13:29:54 +08:00
Ivan Sein
ecd55ae37d
Set CODE_SIGN_INJECT_BASE_ENTITLEMENTS=NO in FileProviderExt.
Signed-off-by: Ivan Sein <ivan@nextcloud.com>
2023-05-12 13:29:54 +08:00
Ivan Sein
a859107ec0
Disable automatically manage signing in FileProviderExt target.
Signed-off-by: Ivan Sein <ivan@nextcloud.com>
2023-05-12 13:29:54 +08:00
Ivan Sein
169b1a765e
Use Nextcloud team id.
Signed-off-by: Ivan Sein <ivan@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