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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user