Skip to content

fix(drivers/189pc): pass pointer to RenameResp in Rename method#2647

Open
Ovear wants to merge 1 commit into
OpenListTeam:mainfrom
Ovear:fix-189pc-rename
Open

fix(drivers/189pc): pass pointer to RenameResp in Rename method#2647
Ovear wants to merge 1 commit into
OpenListTeam:mainfrom
Ovear:fix-189pc-rename

Conversation

@Ovear

@Ovear Ovear commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

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.

  • This PR has breaking changes.
    / 此 PR 包含破坏性变更。
  • This PR changes public API, config, storage format, or migration behavior.
    / 此 PR 修改了公开 API、配置、存储格式或迁移行为。
  • This PR requires corresponding changes in related repositories.
    / 此 PR 需要关联仓库同步修改。

Testing / 测试

  • go test ./...
  • Manual test / 手动测试: 网页端/SFTP手动重命名后正常显示新文件名

Checklist / 检查清单

  • I have read CONTRIBUTING.
    / 我已阅读 CONTRIBUTING
  • I confirm this contribution follows the repository license, contribution policy, and code of conduct.
    / 我确认此贡献符合仓库许可证、贡献规范和行为准则。
  • I have formatted the changed code with gofmt, go fmt, or prettier where applicable.
    / 我已按适用情况使用 gofmtgo fmtprettier 格式化变更代码。
  • I have requested review from relevant maintainers or code owners where applicable.
    / 我已在适用情况下请求相关维护者或代码所有者审查。

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.
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.

1 participant