From 3bd7596873ec069e17acbe394d53470a2f94365d Mon Sep 17 00:00:00 2001 From: J H Date: Thu, 22 Feb 2024 16:39:16 -0700 Subject: [PATCH] chore: Fix some issues in the installation of a package and other rpc things --- container-runtime/src/Adapters/RpcListener.ts | 8 ++++++++ .../src/Adapters/Systems/SystemForEmbassy/index.ts | 3 +-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/container-runtime/src/Adapters/RpcListener.ts b/container-runtime/src/Adapters/RpcListener.ts index 815a5538e..202e942b5 100644 --- a/container-runtime/src/Adapters/RpcListener.ts +++ b/container-runtime/src/Adapters/RpcListener.ts @@ -204,6 +204,14 @@ export class RpcListener { id, ...result, })) + .then((x) => { + if ( + ("result" in x && x.result === undefined) || + !("error" in x || "result" in x) + ) + (x as any).result = null + return x + }) .catch((error) => ({ jsonrpc, id, diff --git a/container-runtime/src/Adapters/Systems/SystemForEmbassy/index.ts b/container-runtime/src/Adapters/Systems/SystemForEmbassy/index.ts index f984bb489..339df6460 100644 --- a/container-runtime/src/Adapters/Systems/SystemForEmbassy/index.ts +++ b/container-runtime/src/Adapters/Systems/SystemForEmbassy/index.ts @@ -30,7 +30,6 @@ import { JsonPath, unNestPath } from "../../../Models/JsonPath" import { HostSystem } from "../../../Interfaces/HostSystem" import { RpcResult, matchRpcResult } from "../../RpcListener" import { ServiceInterface } from "../../../../../sdk/dist/cjs/lib/types" -import { createUtils } from "../../../../../sdk/dist/cjs/lib/util" type Optional = A | undefined | null function todo(): never { @@ -880,7 +879,7 @@ async function updateConfig( ) { if (!dictionary([string, unknown]).test(spec)) return if (!dictionary([string, unknown]).test(mutConfigValue)) return - const utils = createUtils(effects) + const utils = util.createUtils(effects) for (const key in spec) { const specValue = spec[key]