mirror of
https://github.com/oven-sh/bun
synced 2026-02-15 21:32:05 +00:00
Fixes a race condition where IO reader chunks could arrive after the cat builtin transitioned to terminal states (.done, .waiting_write_err, .idle), causing a panic with "Invalid state". This was particularly reproducible on Windows in package scripts. The fix handles these terminal states gracefully in onIOReaderChunk() by ignoring late-arriving chunks since the reader is already being cleaned up. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>