fix(sync): (Codex) OneDrive zero-byte upload fix#1405
Open
cyfung1031 wants to merge 1 commit intomainfrom
Open
fix(sync): (Codex) OneDrive zero-byte upload fix#1405cyfung1031 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.
问题分析
当前
OneDriveFileWriter.write()对所有内容都走createUploadSession,然后生成:当内容为空时,
size = 0,会变成非法 header:这会导致空脚本、空资源、空元数据上传到 OneDrive 失败。这个问题不依赖 typed error、同步冲突检测或缓存修复。
本地改动
改了 packages/filesystem/onedrive/rw.ts :
当
size === 0时,改用 OneDrive simple upload:非空内容继续使用原来的 upload session 路径,避免扩大行为变更。
补了测试在 packages/filesystem/onedrive/onedrive.test.ts:
Content-Range仍为正常值,例如bytes 0-2/3