fix(sync): (Codex) 让云同步上传传递 modifiedDate 以启用 S3 元数据写入#1408
Open
cyfung1031 wants to merge 1 commit intomainfrom
Open
fix(sync): (Codex) 让云同步上传传递 modifiedDate 以启用 S3 元数据写入#1408cyfung1031 wants to merge 1 commit intomainfrom
cyfung1031 wants to merge 1 commit intomainfrom
Conversation
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.
标题
让云同步上传传递 modifiedDate 以启用 S3 元数据写入
概述
本 PR 让 cloud sync 在创建云端文件时显式传递
modifiedDate,使 S3 writer 现有的x-amz-meta-createtime写入能力能被同步上传路径实际使用。主要改动:
pushScript()上传脚本.user.js时传入脚本更新时间。pushScript()上传.meta.json时使用同一个脚本更新时间。scriptcat-sync.json时传入当前时间。.meta.json时传入当前时间。fs.create()收到正确的modifiedDate。modifiedDate后会写入x-amz-meta-createtimeheader。背景
S3 writer 已经支持在
FileCreateOptions.modifiedDate存在时写入:但 cloud sync 上传脚本和同步元数据时之前没有传
modifiedDate,导致这条 S3 metadata 写入路径在同步场景下没有被实际使用。这会让 S3 同步上传缺少更明确的时间元数据,也让已有 writer 能力和 cloud sync 调用之间不一致。
行为变化
脚本上传
pushScript()现在会计算:并作为
modifiedDate传给:${uuid}.user.js${uuid}.meta.json这样脚本文件和对应 meta 文件会共享同一个脚本时间。
同步状态文件
写入
scriptcat-sync.json时使用:作为
modifiedDate。删除标记文件
syncDelete开启时,写入删除 tombstone.meta.json使用:作为
modifiedDate。不改变的行为
本 PR 不实现 S3
list()的 HEAD metadata 读取。原因是读取
x-amz-meta-createtime通常需要对每个对象额外发 HEAD 请求。对大量同步文件来说,这会显著增加请求数和延迟。当前 PR 只补齐上传路径,让已有 metadata 写入能力先被使用;是否在 list 阶段读取 metadata 应作为独立设计处理。本 PR 也不改变: