Skip to content

Fix some bugs with file locking#66

Merged
claucambra merged 12 commits into
mainfrom
bugfix/lock-files
Apr 25, 2025
Merged

Fix some bugs with file locking#66
claucambra merged 12 commits into
mainfrom
bugfix/lock-files

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>
Signed-off-by: Claudio Cambra <developer@claudiocambra.com>
Signed-off-by: Claudio Cambra <developer@claudiocambra.com>
@claucambra claucambra added this to the 2.1 milestone Apr 25, 2025
@claucambra claucambra requested a review from Copilot April 25, 2025 10:00
@claucambra claucambra self-assigned this Apr 25, 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 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>
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 25, 2025

Codecov Report

Attention: Patch coverage is 65.84158% with 69 lines in your changes missing coverage. Please review.

Project coverage is 81.61%. Comparing base (815c3ea) to head (bbf1bf2).
Report is 13 commits behind head on main.

Files with missing lines Patch % Lines
Sources/NextcloudFileProviderKit/Item/Item.swift 0.00% 46 Missing ⚠️
...ces/NextcloudFileProviderKit/Item/Item+Fetch.swift 21.05% 15 Missing ⚠️
...udFileProviderKit/Item/Item+ModifyUnuploaded.swift 0.00% 4 Missing ⚠️
...extcloudFileProviderKitTests/ItemCreateTests.swift 60.00% 2 Missing ⚠️
...extcloudFileProviderKitTests/ItemModifyTests.swift 60.00% 2 Missing ⚠️
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.
📢 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 merged commit 372e3ce into main Apr 25, 2025
1 of 3 checks passed
@Rello Rello deleted the bugfix/lock-files branch August 15, 2025 07:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants