From a225188e240474fc8977cc3d067aad4a87574c88 Mon Sep 17 00:00:00 2001 From: Philipp Kunz Date: Wed, 16 Oct 2024 02:28:31 +0200 Subject: [PATCH] fix(SmartDuplex): Fix stream termination when reading from a web readable stream --- changelog.md | 5 +++++ ts/00_commitinfo_data.ts | 2 +- ts/smartstream.classes.smartduplex.ts | 2 +- ts_web/00_commitinfo_data.ts | 2 +- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/changelog.md b/changelog.md index 2aa29f2..dc9d296 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,10 @@ # Changelog +## 2024-10-16 - 3.2.4 - fix(SmartDuplex) +Fix stream termination when reading from a web readable stream + +- Resolved an issue in SmartDuplex where the stream did not properly terminate after reaching the end of a web readable stream. + ## 2024-10-16 - 3.2.3 - fix(smartduplex) Enhance documentation for read function in SmartDuplex diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts index 5d8e696..68ef49f 100644 --- a/ts/00_commitinfo_data.ts +++ b/ts/00_commitinfo_data.ts @@ -3,6 +3,6 @@ */ export const commitinfo = { name: '@push.rocks/smartstream', - version: '3.2.3', + version: '3.2.4', description: 'A library to simplify the creation and manipulation of Node.js streams, providing utilities for handling transform, duplex, and readable/writable streams effectively in TypeScript.' } diff --git a/ts/smartstream.classes.smartduplex.ts b/ts/smartstream.classes.smartduplex.ts index e6fd54a..a6325a1 100644 --- a/ts/smartstream.classes.smartduplex.ts +++ b/ts/smartstream.classes.smartduplex.ts @@ -68,7 +68,7 @@ export class SmartDuplex extends Duplex { } reader.releaseLock(); if (done) { - smartDuplex.end(); + smartDuplex.push(null); } }, }); diff --git a/ts_web/00_commitinfo_data.ts b/ts_web/00_commitinfo_data.ts index 5d8e696..68ef49f 100644 --- a/ts_web/00_commitinfo_data.ts +++ b/ts_web/00_commitinfo_data.ts @@ -3,6 +3,6 @@ */ export const commitinfo = { name: '@push.rocks/smartstream', - version: '3.2.3', + version: '3.2.4', description: 'A library to simplify the creation and manipulation of Node.js streams, providing utilities for handling transform, duplex, and readable/writable streams effectively in TypeScript.' }