From c08a501fa5e46cf7181fcd21adb46d50c735bac8 Mon Sep 17 00:00:00 2001 From: Philipp Kunz Date: Wed, 16 Oct 2024 10:09:59 +0200 Subject: [PATCH] fix(VirtualStream): Fix stream closure logic in method --- changelog.md | 5 +++++ ts/00_commitinfo_data.ts | 2 +- ts/classes.virtualstream.ts | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index cc1d6d2..7c31dc9 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,10 @@ # Changelog +## 2024-10-16 - 3.1.10 - fix(VirtualStream) +Fix stream closure logic in `writeToWebstream` method + +- Added `writer.releaseLock()` call before closing WritableStream when `closingBit` is received in `writeToWebstream` method. + ## 2024-10-16 - 3.1.9 - fix(VirtualStream) Ensure writable streams are correctly closed asynchronously to prevent potential sync issues. diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts index f277da9..0f61222 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.9', + version: '3.1.10', 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 d312ca3..a614953 100644 --- a/ts/classes.virtualstream.ts +++ b/ts/classes.virtualstream.ts @@ -404,6 +404,7 @@ export class VirtualStream implements plugins.typedRequestInterf while(this.keepAlive || this.receiveBackpressuredArray.checkHasItems()) { const value = await this.fetchData(); if (value === closingBit) { + writer.releaseLock(); await writableStreamArg.close(); break; }