fix: enhance file and trash services with metadata validation#12529
fix: enhance file and trash services with metadata validation#12529wanghe-fit2cloud merged 3 commits into1Panel-dev:dev-v2from
Conversation
…te related functions
|
Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
…e in recycle bin service
|
/lgtm |
What this PR does / why we need it?
#12525
Summary of your change
This pull request introduces a significant refactor and enhancement to the recycle bin implementation, transitioning from a legacy, monolithic file structure to a more robust design using separate
filesandinfosubdirectories with dedicated metadata files. It improves the management, recovery, and cleanup of deleted files, adds better error handling and logging, and refactors file name validation for consistency.Recycle Bin Architecture Improvements
.1panel_clash/filesfor file content and.1panel_clash/infofor metadata, using a new.trashinfometadata format for each entry. This design makes it easier to manage, recover, and clean up deleted files. [1] [2]ensureTrashDirs,writeTrashInfo,readTrashInfo, etc.) handle the creation and management of these subdirectories and metadata files, improving code maintainability.File Deletion and Recovery Enhancements
.trashinfometadata, reducing orphaned metadata and potential inconsistencies. [1] [2] [3]CreateandReduceoperations for the recycle bin are updated to use the new metadata format, improving the accuracy of recovery and metadata tracking. [1] [2]Improved Listing and Paging of Deleted Files
Page) now aggregates entries from both the new structure and legacy files for backward compatibility, and prunes orphaned metadata files automatically. [1] [2]Error Handling and Logging
Code Refactoring and Validation Consistency
hasInvalidFileNamefunction for consistency across file creation and renaming operations. [1] [2]These changes collectively make the recycle bin more reliable, maintainable, and user-friendly, with better support for recovery and system integrity.#
Please indicate you've done the following: