Skip to content

fix: enhance file deletion handling and add option to hide uploading files and fix cloudreve refresh_token get error #9200

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

alist666
Copy link
Contributor

@alist666 alist666 commented Jul 5, 2025

cloudreve 文件删除方法和修改refresh_token获取错误

…files and fix cloudreve refresh_token get error
Copy link

Walkthrough: This PR enhances the file deletion handling in the Cloudreve driver by implementing a retry mechanism for lock conflicts, adds an option to hide files currently being uploaded, and fixes the refresh token retrieval error. Additionally, it changes the HTTP method for a callback request.

Changes:

File Summary
drivers/cloudreve_v4/driver.go Enhanced file deletion with retry on lock conflict, added filter to hide uploading files, fixed thumbnail condition, and corrected rename endpoint.
drivers/cloudreve_v4/meta.go Added HideUploading option to configuration.
drivers/cloudreve_v4/types.go Introduced constants for metadata keys, changed Metadata type, and added FileDeleteResp struct.
drivers/cloudreve_v4/util.go Fixed refresh token logic and changed callback request method from POST to GET.

return nil
}

// 若存在锁冲突,则先清除锁再重试

Choose a reason for hiding this comment

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

The retry mechanism for lock conflicts in file deletion is a good addition. However, ensure that the error handling for the del() function is robust enough to handle unexpected errors beyond lock conflicts.

@@ -470,7 +471,7 @@ func (d *CloudreveV4) upS3(ctx context.Context, file model.FileStreamer, u FileU
}

// 上传成功发送回调请求

Choose a reason for hiding this comment

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

Changing the HTTP method from POST to GET for the callback request might have implications on the server-side logic. Ensure that the server is configured to handle GET requests for this endpoint.

@skysliences skysliences self-requested a review July 14, 2025 02:16
ILoveScratch2

This comment was marked as outdated.

@skysliences skysliences requested a review from bbmacaa July 25, 2025 03:01
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.

4 participants