Skip to content

Add chunked general download uploads#126

Merged
mefree2098 merged 1 commit into
mainfrom
scoreflow-chunked-download-upload
May 19, 2026
Merged

Add chunked general download uploads#126
mefree2098 merged 1 commit into
mainfrom
scoreflow-chunked-download-upload

Conversation

@mefree2098
Copy link
Copy Markdown
Owner

Summary

  • add resumable chunk upload/status support for admin-managed general downloads
  • keep existing one-shot upload endpoint while allowing large ScoreFlow seed uploads to complete in smaller requests
  • cover chunk resume/finalize/hash behavior in storage tests

Verification

  • NODE_ENV=test node --test tests/generalDownloadStorage.test.js
  • node --check server/services/generalDownloadStorage.js && node --check server/routes/generalDownloadRoutes.js
  • npm test (612/612)

@mefree2098 mefree2098 merged commit aa48ea5 into main May 19, 2026
10 checks passed
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

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