Repository navigation
fix(onboard): convert stdout Buffer to string in gateway container probe - #2053
Conversation
verifyGatewayContainerRunning() calls result.stdout.trim() but the run() helper returns stdout as a Buffer. On second onboard (gateway already running), this crashes with TypeError: .trim is not a function. Wrap with String() to ensure trim() works on both Buffer and string. Signed-off-by: Truong Nguyen <[email protected]> Made-with: Cursor
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughA type coercion fix in the Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
ericksoa
left a comment
There was a problem hiding this comment.
Correct, minimal fix. spawnSync with stdio: "pipe" returns stdout as a Buffer — the original (result.stdout || "").trim() from #2032 doesn't coerce it to a string, so the === "true" comparison fails on second sandbox onboard. String() is the right fix.
Non-blocking thought for a follow-up: there may be other run() callsites in onboard.ts with the same implicit Buffer-as-string assumption. Could be worth auditing, or adding encoding: "utf8" to spawnSync in run() so it returns strings globally.
Summary
One-line fix — verifyGatewayContainerRunning() crashes with TypeError on second sandbox onboard because result.stdout is a Buffer, not a string.
Related Issue
Regression from PR #2032.
Detailed issue at 2054
Changes
Type of Change
Verification
npx prek run --all-filespassesnpm testpassesAI Disclosure
Signed-off-by: Truong Nguyen [email protected]
Summary by CodeRabbit