fix: Pipe process.stdout.write through Buffer to fix node incompatibility - #29232
lindskogen wants to merge 2 commits into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughAdds string-to-Buffer normalization for non-UTF8 encodings in file stream write paths and introduces regression tests exercising process.stdout.write behavior with various encodings ("binary"/"latin1", "hex", and default UTF-8). Changes
🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@test/js/node/process/process-stdio.test.ts`:
- Around line 164-204: Each test that spawns a process (the three tests using
spawnSync with bunExe and bunEnv) lacks an assertion on the child process exit
code; update each test to capture the spawnSync result's exitCode (from the
object returned by spawnSync) and add an assertion after the existing stdout
Buffer checks to ensure exitCode is 0 (or the expected success code). Locate the
three tests named "process.stdout.write(string, '%s') writes raw bytes",
"process.stdout.write(string, 'hex') decodes hex", and
"process.stdout.write(string) defaults to UTF-8" and add the exitCode assertion
immediately after the Buffer.compare / stdout checks for each spawnSync call.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 4401ef1f-f0f0-40a2-9359-e7472a07009e
📒 Files selected for processing (2)
src/js/internal/fs/streams.tstest/js/node/process/process-stdio.test.ts
What does this PR do?
Happened upon a bug in bun, where it currently ignores the
encodingparameter ofprocess.stdout.write. This PR makes it so it usesBuffer.fromto encode the data.How did you verify your code works?