Skip to content
Permalink
Browse files
fix: prevent Target closed errors on streams (#7728)
This change prevents Target closed errors when reading streams which were caused by ending the stream before IO.close returns.
  • Loading branch information
jschfflr committed Oct 27, 2021
1 parent 07febca commit 5b792de7a97611441777d1ac99cb95516301d7dc
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/common/helper.ts
@@ -364,9 +364,9 @@ async function getReadableFromProtocolStream(
const response = await client.send('IO.read', { handle, size });
this.push(response.data, response.base64Encoded ? 'base64' : undefined);
if (response.eof) {
this.push(null);
eof = true;
await client.send('IO.close', { handle });
this.push(null);
}
},
});

0 comments on commit 5b792de

Please sign in to comment.