mirror of
https://github.com/fluencelabs/fluence-js.git
synced 2025-06-28 15:21:33 +00:00
Fix
This commit is contained in:
@ -17,7 +17,7 @@
|
|||||||
import { Fluence, type ClientConfig } from "@fluencelabs/js-client";
|
import { Fluence, type ClientConfig } from "@fluencelabs/js-client";
|
||||||
import { fromByteArray } from "base64-js";
|
import { fromByteArray } from "base64-js";
|
||||||
|
|
||||||
// import { test as particleTest } from "./_aqua/finalize_particle.js";
|
import { test as particleTest } from "./_aqua/finalize_particle.js";
|
||||||
import {
|
import {
|
||||||
registerHelloWorld,
|
registerHelloWorld,
|
||||||
helloTest,
|
helloTest,
|
||||||
@ -94,8 +94,7 @@ export const runTest = async (): Promise<TestResult> => {
|
|||||||
|
|
||||||
console.log("running particle test...");
|
console.log("running particle test...");
|
||||||
|
|
||||||
// TODO: Currently this behavior will timeout after TTL bcs this function don't call 'responseSrc'. Will be attended in the next updates
|
await particleTest();
|
||||||
//await particleTest();
|
|
||||||
|
|
||||||
const returnVal = {
|
const returnVal = {
|
||||||
hello,
|
hello,
|
||||||
|
@ -50,6 +50,7 @@ export type CallAquaFunctionArgs = {
|
|||||||
config: CallAquaFunctionConfig | undefined;
|
config: CallAquaFunctionConfig | undefined;
|
||||||
peer: FluencePeer;
|
peer: FluencePeer;
|
||||||
args: { [key: string]: JSONValue | ArgCallbackFunction };
|
args: { [key: string]: JSONValue | ArgCallbackFunction };
|
||||||
|
fireAndForget?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type CallAquaFunctionConfig = {
|
export type CallAquaFunctionConfig = {
|
||||||
@ -61,6 +62,8 @@ export const callAquaFunction = async ({
|
|||||||
config = {},
|
config = {},
|
||||||
peer,
|
peer,
|
||||||
args,
|
args,
|
||||||
|
// TODO: remove after LNG-286 is done
|
||||||
|
fireAndForget = false,
|
||||||
}: CallAquaFunctionArgs) => {
|
}: CallAquaFunctionArgs) => {
|
||||||
log.trace("calling aqua function %j", { script, config, args });
|
log.trace("calling aqua function %j", { script, config, args });
|
||||||
|
|
||||||
@ -88,7 +91,9 @@ export const callAquaFunction = async ({
|
|||||||
registerParticleScopeService(peer, particle, service);
|
registerParticleScopeService(peer, particle, service);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (fireAndForget) {
|
||||||
registerParticleScopeService(peer, particle, responseService(resolve));
|
registerParticleScopeService(peer, particle, responseService(resolve));
|
||||||
|
}
|
||||||
|
|
||||||
registerParticleScopeService(peer, particle, injectRelayService(peer));
|
registerParticleScopeService(peer, particle, injectRelayService(peer));
|
||||||
|
|
||||||
|
@ -615,6 +615,20 @@ export abstract class FluencePeer {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
// TODO: remove after LNG-286 is done
|
||||||
|
// eslint-disable-next-line eqeqeq
|
||||||
|
if (
|
||||||
|
this.jsServiceHost.getHandler(
|
||||||
|
"callbackSrv",
|
||||||
|
"response",
|
||||||
|
item.particle.id,
|
||||||
|
) == null &&
|
||||||
|
item.result.nextPeerPks.length == 0
|
||||||
|
) {
|
||||||
|
// try to finish script
|
||||||
|
item.onSuccess({});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return connectionPromise;
|
return connectionPromise;
|
||||||
|
Reference in New Issue
Block a user