Add chunked general download uploads#126
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2402d27c0f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| await fs.promises.mkdir(path.dirname(absolutePath), { recursive: true }); | ||
|
|
||
| const tempPath = getChunkUploadTempPath(absolutePath); |
There was a problem hiding this comment.
Isolate chunk uploads per session
Using a single deterministic staging path for every upload to the same target allows concurrent sessions to write into the same temp file. In writeDownloadChunk, two clients uploading the same path (or one retrying from offset=0 while another is in progress) will share tempPath, and the later request can truncate/overwrite bytes from the other session, producing a corrupted finalized file even though both chunk requests individually return success.
Useful? React with 👍 / 👎.
Summary
Verification