fix(drivers/189pc): pass pointer to RenameResp in Rename method#2647
Merged
Conversation
Rename function passed RenameResp by value instead of pointer, causing the API response to be discarded and producing a zero-value file entry with empty name, zero size, and zero timestamps after rename.
xrgzs
approved these changes
Jun 23, 2026
xrgzs
left a comment
Member
There was a problem hiding this comment.
检查了一下,其他部分的没有这个问题。
Let me thoroughly check all files for similar issues.
Searched for regex \bresp\b (**/drivers/189pc/**), 83 results
全面排查了 189pc 下所有文件中 y.request、y.get、y.post 的调用,逐个确认 resp 参数是否传了指针:
| 文件 | 行 | 代码 | 状态 |
|---|---|---|---|
utils.go:250 |
var resp Cloud189FilesResp → &resp |
✅ | |
utils.go:847 |
var resp CommitMultiUploadFileResp → &resp |
✅ | |
utils.go:1093 |
var resp CommitMultiUploadFileResp → &resp |
✅ | |
utils.go:1266 |
var resp OldCommitUploadFileResp → &resp |
✅ | |
utils.go:1357 |
var resp FamilyInfoListResp → &resp |
✅ | |
utils.go:1468 |
var resp CreateBatchTaskResp → &resp |
✅ | |
utils.go:1483 |
var resp BatchTaskStateResp → &resp |
✅ | |
utils.go:1498 |
var resp BatchTaskConflictTaskInfoResp → &resp |
✅ | |
utils.go:1556 |
var resp CapacityResp → &resp |
✅ | |
utils.go:675 |
y.get(..., nil) |
✅ (不需要解析) | |
utils.go:1281 |
y.get(..., nil) |
✅ (不需要解析) | |
torrent.go:164 |
var resp CommitMultiUploadFileResp → &resp |
✅ | |
driver.go:169 |
y.get(..., &downloadUrl) |
✅ | |
driver.go:227 |
y.post(..., &newFolder) |
✅ | |
driver.go:294 |
var resp RenameResp → resp |
🐛 已修复 |
只有 driver.go 的 Rename 这一处有问题,刚才已经修好了。其余所有调用都正确传了 &resp 指针。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary / 摘要
修复189pc驱动重命名后,未正确将返回存入变量,导致重命名的项目会变成零值项目,表现为空文件名文件,并持续到下次列表缓存刷新。
网页端API返回该空文件对象类似如下:
{ "1": { "name": "", "size": 0, "is_dir": false, "modified": "0001-01-01T00:00:00Z", "created": "0001-01-01T00:00:00Z", "sign": "__REDACTED__", "thumb": "", "type": 0, "hashinfo": "{\"md5\":\"\"}", "hash_info": { "md5": "" } } }Rename function passed RenameResp by value instead of pointer, causing the API response to be discarded and producing a zero-value file entry with empty name, zero size, and zero timestamps after rename.
/ 此 PR 包含破坏性变更。
/ 此 PR 修改了公开 API、配置、存储格式或迁移行为。
/ 此 PR 需要关联仓库同步修改。
Testing / 测试
go test ./...Checklist / 检查清单
/ 我已阅读 CONTRIBUTING。
/ 我确认此贡献符合仓库许可证、贡献规范和行为准则。
gofmt,go fmt, orprettierwhere applicable./ 我已按适用情况使用
gofmt、go fmt或prettier格式化变更代码。/ 我已在适用情况下请求相关维护者或代码所有者审查。