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

@@ -31,6 +31,10 @@ export class TypedHandler<T extends plugins.typedRequestInterfaces.ITypedRequest
}
let typedResponseError: TypedResponseError;
const typedtoolsInstance = new TypedTools();
// Pass localData from the request to TypedTools so handlers can access transport-layer context
if (typedRequestArg.localData) {
typedtoolsInstance.localData = typedRequestArg.localData;
}
const response = await this.handlerFunction(typedRequestArg.request, typedtoolsInstance).catch((e) => {
if (e instanceof TypedResponseError) {
typedResponseError = e;