Skip to content

Commit

Permalink
fix: prevent Target closed errors on streams (#7728)
Browse files Browse the repository at this point in the history
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 5b792de
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/common/helper.ts
Expand Up @@ -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);
}
},
});
Expand Down

0 comments on commit 5b792de

Please sign in to comment.