fix(virtualstream): Expose transport localData to handlers via TypedTools; improve VirtualStream payload encode/decode to preserve built-ins and handle nested arrays/objects

This commit is contained in:
2025-12-03 23:51:47 +00:00
parent 248430b5ad
commit b730a977dc
5 changed files with 32 additions and 2 deletions

View File

@@ -1,5 +1,13 @@
# Changelog
## 2025-12-03 - 3.1.11 - fix(virtualstream)
Expose transport localData to handlers via TypedTools; improve VirtualStream payload encode/decode to preserve built-ins and handle nested arrays/objects
- TypedHandler: pass typedRequest.localData into a TypedTools instance so handlers can access transport-layer context (e.g. websocket peer).
- TypedTools: add a public localData property to store transport-specific context available to handlers.
- VirtualStream.decodePayloadFromNetwork: preserve built-in objects (Set, Map, Date, RegExp, Error, Promise or thenable) to avoid incorrect transformation.
- VirtualStream.encodePayloadForNetwork / decodePayloadFromNetwork: added proper recursion for arrays and objects to correctly handle nested payloads and virtual streams, with path tracking to support deduplication logic.
## 2024-10-16 - 3.1.10 - fix(VirtualStream)
Fix stream closure logic in `writeToWebstream` method