From 0af720d901dde1e6ad86e220877fed23fc428770 Mon Sep 17 00:00:00 2001 From: Philipp Kunz Date: Wed, 16 Oct 2024 02:15:17 +0200 Subject: [PATCH] fix(VirtualStream): Corrected the logic for backpressure handling in response --- changelog.md | 6 ++++++ ts/00_commitinfo_data.ts | 2 +- ts/classes.virtualstream.ts | 3 ++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/changelog.md b/changelog.md index 7bc68ea..60eb4ce 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,11 @@ # Changelog +## 2024-10-16 - 3.1.4 - fix(VirtualStream) +Corrected the logic for backpressure handling in response + +- Fixed backpressure flag assignment in the response handling logic of VirtualStream. +- Ensured correct negation logic for checking receive backpressure status. + ## 2024-10-14 - 3.1.3 - fix(VirtualStream) Fix keepAlive flag handling in VirtualStream and added stream closure in tests diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts index df2b448..ee8d532 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.3', + version: '3.1.4', 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 3ca315c..d3dfe98 100644 --- a/ts/classes.virtualstream.ts +++ b/ts/classes.virtualstream.ts @@ -269,7 +269,7 @@ export class VirtualStream implements plugins.typedRequestInterf cycle: 'response', mainPurpose: 'chunk', next: this.sendBackpressuredArray.data.length > 1, - backpressure: this.receiveBackpressuredArray.checkSpaceAvailable(), + backpressure: !this.receiveBackpressuredArray.checkSpaceAvailable(), chunkData: this.sendBackpressuredArray.shift(), }; } else { @@ -279,6 +279,7 @@ export class VirtualStream implements plugins.typedRequestInterf cycle: 'response', mainPurpose: 'feedback', next: this.sendBackpressuredArray.data.length > 0, + backpressure: !this.receiveBackpressuredArray.checkSpaceAvailable(), }; } streamTrArg.request = null;