diff --git a/changelog.md b/changelog.md index a4ce420..cc1d6d2 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,10 @@ # Changelog +## 2024-10-16 - 3.1.9 - fix(VirtualStream) +Ensure writable streams are correctly closed asynchronously to prevent potential sync issues. + +- Updated VirtualStream to use 'await' when closing writable streams, ensuring proper asynchronous handling. + ## 2024-10-16 - 3.1.8 - fix(VirtualStream) Fix stream closing behavior to correctly handle closing bits diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts index 590aeba..f277da9 100644 --- a/ts/00_commitinfo_data.ts +++ b/ts/00_commitinfo_data.ts @@ -3,6 +3,6 @@ */ export const commitinfo = { name: '@api.global/typedrequest', - version: '3.1.8', + version: '3.1.9', description: 'A TypeScript library for making typed requests towards APIs, including facilities for handling requests, routing, and virtual stream handling.' } diff --git a/ts/classes.virtualstream.ts b/ts/classes.virtualstream.ts index f50e4e1..d312ca3 100644 --- a/ts/classes.virtualstream.ts +++ b/ts/classes.virtualstream.ts @@ -404,7 +404,7 @@ export class VirtualStream implements plugins.typedRequestInterf while(this.keepAlive || this.receiveBackpressuredArray.checkHasItems()) { const value = await this.fetchData(); if (value === closingBit) { - writableStreamArg.close(); + await writableStreamArg.close(); break; } await writer.write(value);