Skip to content

Commit 11cc4f1

Browse files
committed
fix: use separate TextDecoder per stream to avoid cross-stream corruption
1 parent 04ddac9 commit 11cc4f1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/node/services/slashCommandService.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,10 +169,9 @@ export class SlashCommandService extends EventEmitter {
169169
await writer.close();
170170
}
171171

172-
// Read stdout and stderr in parallel
173-
const decoder = new TextDecoder();
174-
172+
// Read stdout and stderr in parallel (separate decoders to avoid cross-stream corruption)
175173
const readStdout = async () => {
174+
const decoder = new TextDecoder();
176175
const reader = stream.stdout.getReader();
177176
try {
178177
while (true) {
@@ -193,6 +192,7 @@ export class SlashCommandService extends EventEmitter {
193192
};
194193

195194
const readStderr = async () => {
195+
const decoder = new TextDecoder();
196196
const reader = stream.stderr.getReader();
197197
try {
198198
while (true) {

0 commit comments

Comments
 (0)