From 88320488a7cbea8385f3513eeb19d72d9cbd715b Mon Sep 17 00:00:00 2001 From: Jade <2364004+Blu-J@users.noreply.github.com> Date: Wed, 30 Oct 2024 14:41:06 -0600 Subject: [PATCH] fix: Actions like the action don't give the results (#2770) --- container-runtime/src/Adapters/RpcListener.ts | 13 +++++++------ .../src/Adapters/Systems/SystemForStartOs.ts | 8 +------- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/container-runtime/src/Adapters/RpcListener.ts b/container-runtime/src/Adapters/RpcListener.ts index f84f7b282..3e86e60d1 100644 --- a/container-runtime/src/Adapters/RpcListener.ts +++ b/container-runtime/src/Adapters/RpcListener.ts @@ -136,11 +136,13 @@ const jsonParse = (x: string) => JSON.parse(x) const handleRpc = (id: IdType, result: Promise) => result - .then((result) => ({ - jsonrpc, - id, - ...result, - })) + .then((result) => { + return { + jsonrpc, + id, + ...result, + } + }) .then((x) => { if ( ("result" in x && x.result === undefined) || @@ -413,7 +415,6 @@ export class RpcListener { const ensureResultTypeShape = ( result: void | T.ActionInput | T.ActionResult | null, ): { result: any } => { - if (isResult(result)) return result return { result } } const callbacks = this.callbackHolderFor(procedure) diff --git a/container-runtime/src/Adapters/Systems/SystemForStartOs.ts b/container-runtime/src/Adapters/Systems/SystemForStartOs.ts index 51b7c24b8..334764a87 100644 --- a/container-runtime/src/Adapters/Systems/SystemForStartOs.ts +++ b/container-runtime/src/Adapters/Systems/SystemForStartOs.ts @@ -1,12 +1,6 @@ -import { ExecuteResult, Procedure, System } from "../../Interfaces/System" -import { unNestPath } from "../../Models/JsonPath" -import matches, { any, number, object, string, tuple } from "ts-matches" +import { System } from "../../Interfaces/System" import { Effects } from "../../Models/Effects" -import { RpcResult, matchRpcResult } from "../RpcListener" -import { duration } from "../../Models/Duration" import { T, utils } from "@start9labs/start-sdk" -import { Volume } from "../../Models/Volume" -import { CallbackHolder } from "../../Models/CallbackHolder" import { Optional } from "ts-matches/lib/parsers/interfaces" export const STARTOS_JS_LOCATION = "/usr/lib/startos/package/index.js"