Further bugfixes for paginated server URL reads#87
Conversation
Signed-off-by: Claudio Cambra <developer@claudiocambra.com>
Signed-off-by: Claudio Cambra <developer@claudiocambra.com>
…NKFile Signed-off-by: Claudio Cambra <developer@claudiocambra.com>
Signed-off-by: Claudio Cambra <developer@claudiocambra.com>
… MockRemoteItem Signed-off-by: Claudio Cambra <developer@claudiocambra.com>
Signed-off-by: Claudio Cambra <developer@claudiocambra.com>
…inated read 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 refines paginated server URL enumeration by improving root container handling, introducing a URL-matching helper, and expanding test coverage for follow-up pagination.
- Skip ingesting metadata for the root container in both
readServerUrlandhandlePagedReadResults. - Add
fullUrlMatches(_:)toNKFilefor detecting the root URL. - Add
testReadServerUrlFollowUpPaginationand adjust existing tests to assert root exclusion.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| Tests/NextcloudFileProviderKitTests/EnumeratorTests.swift | Updated root exclusion test, new pagination follow-up test, formatting |
| Tests/Interface/MockRemoteItem.swift | Changed default name for root/trash mock items to empty strings |
| Sources/.../Extensions/NKFile+Extensions.swift | Added fullUrlMatches(_:) helper on NKFile |
| Sources/.../Enumerator+SyncEngine.swift | Modified logic to skip root container metadata ingestion |
Comments suppressed due to low confidence (4)
Tests/Interface/MockRemoteItem.swift:63
- [nitpick] An empty string for the root item
namecan be ambiguous—consider using an explicit placeholder (e.g., "root") or documenting this choice.
name: "",
Sources/NextcloudFileProviderKit/Extensions/NKFile+Extensions.swift:13
- [nitpick] The method name
fullUrlMatchesis somewhat ambiguous; consider renaming tomatchesFullUrl(_:)orisFullUrl(_:)for clarity.
func fullUrlMatches(_ urlString: String) -> Bool {
Tests/NextcloudFileProviderKitTests/EnumeratorTests.swift:436
- [nitpick] Consider removing
debugPrint(db)calls in tests to reduce noise in test logs.
debugPrint(db)
Sources/NextcloudFileProviderKit/Extensions/NKFile+Extensions.swift:14
- Constructing URLs via string concatenation can lead to edge-case bugs—consider using
URLorURLComponentsfor robust path handling.
var fileUrl = serverUrl + "/" + fileName
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #87 +/- ##
==========================================
+ Coverage 83.60% 83.82% +0.22%
==========================================
Files 70 70
Lines 15337 15553 +216
==========================================
+ Hits 12823 13038 +215
- Misses 2514 2515 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
No description provided.