Skip to content

Further bugfixes for paginated server URL reads#87

Merged
claucambra merged 9 commits into
mainfrom
bugfix/pagination-pt3
Jun 6, 2025
Merged

Further bugfixes for paginated server URL reads#87
claucambra merged 9 commits into
mainfrom
bugfix/pagination-pt3

Conversation

@claucambra
Copy link
Copy Markdown
Contributor

No description provided.

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>
@claucambra claucambra requested a review from Copilot June 6, 2025 12:55
@claucambra claucambra self-assigned this Jun 6, 2025
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 readServerUrl and handlePagedReadResults.
  • Add fullUrlMatches(_:) to NKFile for detecting the root URL.
  • Add testReadServerUrlFollowUpPagination and 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 name can 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 fullUrlMatches is somewhat ambiguous; consider renaming to matchesFullUrl(_:) or isFullUrl(_:) 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 URL or URLComponents for robust path handling.
        var fileUrl = serverUrl + "/" + fileName

@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 6, 2025

Codecov Report

Attention: Patch coverage is 98.21429% with 4 lines in your changes missing coverage. Please review.

Project coverage is 83.82%. Comparing base (41168e0) to head (9a0a733).
Report is 10 commits behind head on main.

Files with missing lines Patch % Lines
...extcloudFileProviderKitTests/EnumeratorTests.swift 98.01% 4 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@claucambra claucambra added this to the 3.0 milestone Jun 6, 2025
@claucambra claucambra added the bug Something isn't working label Jun 6, 2025
@claucambra claucambra merged commit d7a8b48 into main Jun 6, 2025
3 checks passed
@claucambra claucambra deleted the bugfix/pagination-pt3 branch June 6, 2025 13:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants