Fix some bugs with file locking#66
Conversation
Signed-off-by: Claudio Cambra <developer@claudiocambra.com>
Signed-off-by: Claudio Cambra <developer@claudiocambra.com>
Signed-off-by: Claudio Cambra <developer@claudiocambra.com>
Signed-off-by: Claudio Cambra <developer@claudiocambra.com>
There was a problem hiding this comment.
Pull Request Overview
This PR addresses bugs around file locking and synchronization by modifying how file metadata is handled and ensuring that only fully uploaded files are subject to deletion. The changes include updating tests to flag items as uploaded, refining lock file update and creation logic, and narrowing the FilesDatabaseManager query to only consider uploaded files.
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| Tests/NextcloudFileProviderKitTests/FilesDatabaseManagerTests.swift | Updated tests now set the uploaded flag on metadata where appropriate. |
| Sources/NextcloudFileProviderKit/Item/Item.swift | Adjusted the implementation of local URL retrieval for file contents. |
| Sources/NextcloudFileProviderKit/Item/Item+ModifyLockFile.swift | Revised lock file modification to return an error when running on macOS 13.0. |
| Sources/NextcloudFileProviderKit/Item/Item+ModifyUnuploaded.swift | Simplified local file retrieval for unuploaded items using localUrlForContents. |
| Sources/NextcloudFileProviderKit/Item/Item+Modify.swift, Item+Fetch.swift, Item+DeleteLockFile.swift, Item+CreateLockFile.swift | Improvements in the handling of lock file creation, deletion, and fetching. |
| Sources/NextcloudFileProviderKit/Database/FilesDatabaseManager.swift | Changed query to only select uploaded items when processing deletions. |
Signed-off-by: Claudio Cambra <developer@claudiocambra.com>
Signed-off-by: Claudio Cambra <developer@claudiocambra.com>
Signed-off-by: Claudio Cambra <developer@claudiocambra.com>
Signed-off-by: Claudio Cambra <developer@claudiocambra.com>
Signed-off-by: Claudio Cambra <developer@claudiocambra.com>
…anagerTests Signed-off-by: Claudio Cambra <developer@claudiocambra.com>
… handling Signed-off-by: Claudio Cambra <developer@claudiocambra.com>
…ng lock files Signed-off-by: Claudio Cambra <developer@claudiocambra.com>
2171b45 to
bbf1bf2
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #66 +/- ##
==========================================
- Coverage 81.67% 81.61% -0.06%
==========================================
Files 61 61
Lines 12696 12835 +139
==========================================
+ Hits 10369 10475 +106
- Misses 2327 2360 +33 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
No description provided.