fix(VirtualStream): Fix stream closure logic in method
This commit is contained in:
		| @@ -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. | ||||
|  | ||||
|   | ||||
| @@ -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.' | ||||
| } | ||||
|   | ||||
| @@ -404,6 +404,7 @@ export class VirtualStream<T = Uint8Array> implements plugins.typedRequestInterf | ||||
|     while(this.keepAlive || this.receiveBackpressuredArray.checkHasItems()) { | ||||
|       const value = await this.fetchData(); | ||||
|       if (value === closingBit) { | ||||
|         writer.releaseLock(); | ||||
|         await writableStreamArg.close(); | ||||
|         break; | ||||
|       } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user