Repository navigation
Commit 0aa8cd0
authored
fix(release): avoid Node UTF-8 pipe read overflow (#21222)
> ### Branch strategy
>
> - Active development targets `main`.
### What this PR does
Before this PR: Pre Release could crash with exit 139 while Node 24.21.0
read the piped release list.
After this PR: Read stdin as a Buffer before UTF-8 decoding, with
regression coverage for short pipe reads followed by a large write and
duplicate-version rejection.
N/A — no repository issue
### Why we need it and why it was done in this way
The following tradeoffs were made: A one-line workaround for the
affected Node UTF-8 fast path; unchanged release validation rules
The following alternatives were considered: Waiting for the upstream
Node fix or changing the repository-wide Node version
Links to places where the discussion took place: [Failed CI
job](https://github.com/CherryHQ/cherry-studio/actions/runs/36725980695/job/109939082205),
[Node defect](nodejs/node#66341)
### Breaking changes
None
### Special notes for your reviewer
Validation: `pnpm lint`, 83 tests across `release-workflow.test.ts` and
`release-baseline.test.ts`, and the real GitHub release-list pipeline
passed on macOS; the original Linux crash was not reproduced locally and
the remote release workflow has not been rerun.
### Checklist
This checklist is not enforcing, but it's a reminder of items that could
be relevant to every PR.
Approvers are expected to review this list.
- [x] Branch: This PR targets `main`
- [x] PR: The PR description is expressive enough and will help future
contributors
- [x] Code: [Write code that humans can
understand](https://en.wikiquote.org/wiki/Martin_Fowler#code-for-humans)
and [Keep it simple](https://en.wikipedia.org/wiki/KISS_principle)
- [ ] Refactor: You have [left the code cleaner than you found it (Boy
Scout
Rule)](https://learning.oreilly.com/library/view/97-things-every/9780596809515/ch08.html)
- [x] Upgrade: Impact of this change on upgrade flows was considered and
addressed if required
- [ ] Documentation: A [user-guide update](https://docs.cherry-ai.com)
was considered and is present (link) or not required. Check this only
when the PR introduces or changes a user-facing feature or behavior.
- [x] Self-review: I have reviewed my own code (e.g., via
[`/gh-pr-review`](/.claude/skills/gh-pr-review/SKILL.md), `gh pr diff`,
or GitHub UI) before requesting review from others
### Release note
```release-note
NONE
```
Signed-off-by: suyao <[email protected]>1 parent cff21f7 commit 0aa8cd0
2 files changed
Lines changed: 39 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
679 | 679 | | |
680 | 680 | | |
681 | 681 | | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
682 | 719 | | |
683 | 720 | | |
684 | 721 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
113 | | - | |
| 113 | + | |
| 114 | + | |
114 | 115 | | |
115 | 116 | | |
116 | 117 | | |
| |||
0 commit comments