Properly fix deadlocking when trying to access current capabilities#82
Conversation
Signed-off-by: Claudio Cambra <developer@claudiocambra.com>
…rface supports trash Signed-off-by: Claudio Cambra <developer@claudiocambra.com>
…e capabilities 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>
…ait for ongoing requests to finish before proceeding 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>
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 fixes deadlocking when accessing current capabilities by switching from synchronous to asynchronous trash capability checks and refactoring the related APIs. Key changes include updating numerous functions and initializers to accept an asynchronous Boolean flag (remoteSupportsTrash) as well as removing legacy synchronous capabilities methods.
Reviewed Changes
Copilot reviewed 23 out of 23 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| Tests/NextcloudFileProviderKit/EnumeratorTests.swift | Updated rootContainer call to include an async trash support flag. |
| Tests/Interface/MockRemoteInterface.swift | Removed legacy currentCapabilities sync methods and introduced directMockCapabilities. |
| Tests/Interface/MockEnumerator.swift | Changed remoteInterface type to MockRemoteInterface and used directMockCapabilities for trash capability. |
| Sources/NextcloudFileProviderKit/* | Updated multiple Item extension files to pass remoteSupportsTrash via async calls. |
| Sources/NextcloudFileProviderKit/Interface/RemoteInterface.swift | Added async support for currentCapabilities and trash capability checking. |
| Sources/NextcloudFileProviderKit/Interface/NextcloudKit+RemoteInterface.swift | Refactored capability fetching and removed synchronous methods. |
| Sources/NextcloudFileProviderKit/Enumeration/* | Updated asynchronous calls in enumeration functions. |
| Package.swift | Upgraded NextcloudCapabilitiesKit dependency version. |
Comments suppressed due to low confidence (3)
Tests/Interface/MockRemoteInterface.swift:1142
- [nitpick] The method name 'directMockCapabilities' may be misleading; consider renaming it to something like 'mockCapabilitiesData' to clearly indicate its purpose as a mock data provider.
return (account.ncKitAccount, directMockCapabilities(), capsData, .success)
Tests/Interface/MockEnumerator.swift:29
- [nitpick] Ensure that the usage of 'directMockCapabilities' here aligns with its renamed or clarified purpose, so that it accurately reflects retrieving mock trash capability data.
let remoteSupportsTrash = remoteInterface.directMockCapabilities()?.files?.undelete ?? false
Sources/NextcloudFileProviderKit/Item/Item.swift:32
- [nitpick] Consider whether caching the 'remoteSupportsTrash' value is optimal if capabilities rarely change; if not, verify that repeated async retrievals are not impacting performance.
private let remoteSupportsTrash: Bool
Signed-off-by: Claudio Cambra <developer@claudiocambra.com>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #82 +/- ##
==========================================
+ Coverage 81.49% 82.15% +0.66%
==========================================
Files 63 68 +5
Lines 13771 14369 +598
==========================================
+ Hits 11222 11805 +583
- Misses 2549 2564 +15 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
No description provided.