Skip to content

fix(sync): 发布前核对实际上传摘要与内容寻址名称 - #17

Merged
Cnotech merged 1 commit into
mainfrom
codex/verify-published-upload-digest
Nov 18, 2026
Merged

Cnotech merged 1 commit into
mainfrom
codex/verify-published-upload-digest

Conversation

@Cnotech

@Cnotech Cnotech commented Nov 18, 2026

Copy link
Copy Markdown
Owner

文件在预检与传输的两次读取之间发生变化时,sync --verify 可能将不符合内容寻址名称的内容发布,并继续执行额外文件删除。本修复在发布前用上传初始化实际使用的摘要再次核对目标文件名;失败时保留临时副本及旧对象,不回收未经确认的上传 ID。

保留 --verify 门禁与上传前检查,覆盖新建和替换的真实分片 PUT、复用旧 ID 的回执、64-hex 大小写名称及普通文件名。普通同步行为保持兼容。

验证:隔离配置、假凭证及 localhost mock 下,cargo test --locked --offline --no-fail-fast 670 passed / 0 failed;格式检查与 Clippy 通过(既有告警)。未访问真实云盘。

#16 已按要求合并;本修复的直接 main 更新因分支保护要求三个 CI 检查而被拒绝,因此通过此 PR 完成必需检查并合入。

Reject source changes between preflight and transfer before publishing the staged object. Preserve the early verification gate and retain temporary copies without recycling unverified receipt IDs on failure.

Cover new and replacement multipart uploads, reused receipt IDs, and lowercase, uppercase and ordinary filenames.
@Cnotech
Cnotech merged commit 984deb1 into main Nov 18, 2026
3 checks passed
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