From e86b06c2cd2ec83b6b0084b98ddc5764cf77c104 Mon Sep 17 00:00:00 2001 From: Aiden McClelland Date: Sun, 15 Mar 2026 21:45:04 -0600 Subject: [PATCH] fix: register callbacks for getStatus, getServiceManifest, getContainerIp, getSslCertificate These effects were passing the raw JS callback function through rpcRound without converting it to a CallbackId via context.callbacks.addCallback(). Since functions are dropped by JSON.stringify, the Rust side never received a callback, breaking the const() reactive pattern. --- .../src/Adapters/EffectCreator.ts | 26 ++++++++++++------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/container-runtime/src/Adapters/EffectCreator.ts b/container-runtime/src/Adapters/EffectCreator.ts index c244347eb..22328bbb9 100644 --- a/container-runtime/src/Adapters/EffectCreator.ts +++ b/container-runtime/src/Adapters/EffectCreator.ts @@ -187,9 +187,10 @@ export function makeEffects(context: EffectContext): Effects { getServiceManifest( ...[options]: Parameters ) { - return rpcRound("get-service-manifest", options) as ReturnType< - T.Effects["getServiceManifest"] - > + return rpcRound("get-service-manifest", { + ...options, + callback: context.callbacks?.addCallback(options.callback) || null, + }) as ReturnType }, subcontainer: { createFs(options: { imageId: string; name: string }) { @@ -211,9 +212,10 @@ export function makeEffects(context: EffectContext): Effects { > }) as Effects["exportServiceInterface"], getContainerIp(...[options]: Parameters) { - return rpcRound("get-container-ip", options) as ReturnType< - T.Effects["getContainerIp"] - > + return rpcRound("get-container-ip", { + ...options, + callback: context.callbacks?.addCallback(options.callback) || null, + }) as ReturnType }, getOsIp(...[]: Parameters) { return rpcRound("get-os-ip", {}) as ReturnType @@ -244,9 +246,10 @@ export function makeEffects(context: EffectContext): Effects { > }, getSslCertificate(options: Parameters[0]) { - return rpcRound("get-ssl-certificate", options) as ReturnType< - T.Effects["getSslCertificate"] - > + return rpcRound("get-ssl-certificate", { + ...options, + callback: context.callbacks?.addCallback(options.callback) || null, + }) as ReturnType }, getSslKey(options: Parameters[0]) { return rpcRound("get-ssl-key", options) as ReturnType< @@ -308,7 +311,10 @@ export function makeEffects(context: EffectContext): Effects { }, getStatus(...[o]: Parameters) { - return rpcRound("get-status", o) as ReturnType + return rpcRound("get-status", { + ...o, + callback: context.callbacks?.addCallback(o.callback) || null, + }) as ReturnType }, /// DEPRECATED setMainStatus(o: { status: "running" | "stopped" }): Promise {