From c14344e05449073deb303dfb7402437e79bfa110 Mon Sep 17 00:00:00 2001 From: Akim Mamedov Date: Wed, 15 Nov 2023 23:10:33 +0700 Subject: [PATCH] Use new param --- packages/core/js-client/src/api.ts | 4 ++++ packages/core/js-client/src/compilerSupport/callFunction.ts | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/core/js-client/src/api.ts b/packages/core/js-client/src/api.ts index 87015af5..ab618d23 100644 --- a/packages/core/js-client/src/api.ts +++ b/packages/core/js-client/src/api.ts @@ -99,6 +99,9 @@ export const v5_callFunction = async ( }), ); + const returnTypeVoid = + def.arrow.codomain.tag === "nil" || def.arrow.codomain.items.length === 0; + const params = { peer, args: callArgs, @@ -108,6 +111,7 @@ export const v5_callFunction = async ( const result = await callAquaFunction({ script, ...params, + fireAndForget: returnTypeVoid, }); const valueSchema = diff --git a/packages/core/js-client/src/compilerSupport/callFunction.ts b/packages/core/js-client/src/compilerSupport/callFunction.ts index acefb8fc..2d4970f8 100644 --- a/packages/core/js-client/src/compilerSupport/callFunction.ts +++ b/packages/core/js-client/src/compilerSupport/callFunction.ts @@ -50,7 +50,7 @@ export type CallAquaFunctionArgs = { config: CallAquaFunctionConfig | undefined; peer: FluencePeer; args: { [key: string]: JSONValue | ArgCallbackFunction }; - fireAndForget?: boolean; + fireAndForget: boolean | undefined; }; export type CallAquaFunctionConfig = {