fix: Actions like the action don't give the results (#2770)

This commit is contained in:
Jade
2024-10-30 14:41:06 -06:00
committed by GitHub
parent 2091abeea2
commit 88320488a7
2 changed files with 8 additions and 13 deletions

View File

@@ -136,11 +136,13 @@ const jsonParse = (x: string) => JSON.parse(x)
const handleRpc = (id: IdType, result: Promise<RpcResult>) =>
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)

View File

@@ -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"