fix(#2458): [Bug] 新增的文件传输列表功能的暂停和全部暂定功能不生效#2459
Conversation
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e7282d3be7
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| transfer.paused = false; | ||
| transfer.pauseSuperseded = false; | ||
| try { transfer.readStream?.resume?.(); } catch { } | ||
| resumeStreamPair(transfer); |
There was a problem hiding this comment.
Make stream resume idempotent before re-piping
When a resume request is repeated for the same paused stream (for example, double-clicking the resume button before the first async resume updates the UI), the first request has already reattached the pipe, but the second still reaches this line with transfer.paused === false and calls pipe() on the same readable/writable pair again. Node does not deduplicate duplicate pipe() calls, so subsequent chunks are written once per pipe; for local-to-local resumable copies this can promote an oversized/corrupt staged file. Please track whether the pair is currently unpiped or no-op repeated resumes before calling resumeStreamPair().
Useful? React with 👍 / 👎.
|
@codex review |
|
Codex Review: Didn't find any major issues. Swish! Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
|
Codex reported no major issues. This PR is marked ready for human review/merge. |
1 similar comment
|
Codex reported no major issues. This PR is marked ready for human review/merge. |
Summary
OK: Fixed stream transfer pause: unpipe before pause so destination drain cannot auto-resume the upload; resume re-pipes. Added regression test for backpressured stream uploads.
Fixes #2458
Automation
@codex review(own/bot PRs only)