Skip to content

Improve readability of item deletion procedure#73

Merged
claucambra merged 2 commits into
mainfrom
bugfix/improve-delete-api
May 9, 2025
Merged

Improve readability of item deletion procedure#73
claucambra merged 2 commits into
mainfrom
bugfix/improve-delete-api

Conversation

@claucambra
Copy link
Copy Markdown
Contributor

No description provided.

claucambra added 2 commits May 9, 2025 12:19
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 May 9, 2025
@claucambra claucambra requested a review from Copilot May 9, 2025 04:58
@claucambra claucambra self-assigned this May 9, 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 aims to improve the readability and maintainability of the item deletion procedure by restructuring the logic and clarifying internal metadata handling.

  • Splits deletion logic into two private functions: one for deletion and one for trash metadata modification.
  • Revises guard conditions and comments to better express the intent of the trashing parameter.
Comments suppressed due to low confidence (3)

Sources/NextcloudFileProviderKit/Item/Item+Delete.swift:91

  • [nitpick] The function name 'handleMetadataDeletion' might be misleading since it's invoked when the trashing flag is false. Consider renaming it to better reflect its behavior in relation to the trashing parameter.
private func handleMetadataDeletion() {

Sources/NextcloudFileProviderKit/Item/Item+Delete.swift:100

  • [nitpick] Consider revising this comment to more clearly describe the steps required after a trash modification, and to explain how it complements the deletion path.
// NOTE: the trashing metadata modification procedure here is rough. You SHOULD run a rescan of ...

Sources/NextcloudFileProviderKit/Item/Item+Delete.swift:84

  • [nitpick] The guard condition now inverts the original logic. Consider adding an inline comment that clearly explains when the deletion versus trash modification paths are executed.
guard trashing else {

@codecov
Copy link
Copy Markdown

codecov Bot commented May 9, 2025

Codecov Report

Attention: Patch coverage is 79.48718% with 8 lines in your changes missing coverage. Please review.

Project coverage is 81.11%. Comparing base (52e92f5) to head (0dd740a).
Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
...es/NextcloudFileProviderKit/Item/Item+Delete.swift 79.48% 8 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main      #73   +/-   ##
=======================================
  Coverage   81.11%   81.11%           
=======================================
  Files          62       62           
  Lines       13039    13046    +7     
=======================================
+ Hits        10576    10582    +6     
- Misses       2463     2464    +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 merged commit 0315f3b into main May 9, 2025
2 of 3 checks passed
@Rello Rello deleted the bugfix/improve-delete-api 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