diff --git a/container-runtime/src/Adapters/Systems/SystemForEmbassy/index.ts b/container-runtime/src/Adapters/Systems/SystemForEmbassy/index.ts index a87facc56..79c797293 100644 --- a/container-runtime/src/Adapters/Systems/SystemForEmbassy/index.ts +++ b/container-runtime/src/Adapters/Systems/SystemForEmbassy/index.ts @@ -228,7 +228,6 @@ export class SystemForEmbassy implements System { previousVersion: Optional, ): Promise { if (previousVersion) await this.migration(effects, previousVersion) - await this.properties(effects) await effects.setMainStatus({ status: "stopped" }) } private async uninit( @@ -458,9 +457,12 @@ export class SystemForEmbassy implements System { path: "/properties", value: exposeUis.map((x) => x.value), }) - await effects.exposeUi( - exposeUis.map((x, i) => ({ ...x, path: `/properties/${i}` }) as any), - ) + await effects.exposeUi({ + paths: exposeUis.map((x, i) => ({ + ...x, + path: `/properties/${i}`, + })) as any[], + }) } else if (setConfigValue.type === "script") { const moduleCode = this.moduleCode const method = moduleCode.properties @@ -479,9 +481,12 @@ export class SystemForEmbassy implements System { path: "/properties", value: exposeUis.map((x) => x.value), }) - await effects.exposeUi( - exposeUis.map((x, i) => ({ ...x, path: `/properties/${i}` }) as any), - ) + await effects.exposeUi({ + paths: exposeUis.map((x, i) => ({ + ...x, + path: `/properties/${i}`, + })) as any[], + }) } } private async health( diff --git a/core/startos/src/service/service_effect_handler.rs b/core/startos/src/service/service_effect_handler.rs index ea2228e81..48e27134b 100644 --- a/core/startos/src/service/service_effect_handler.rs +++ b/core/startos/src/service/service_effect_handler.rs @@ -340,6 +340,9 @@ async fn set_store( .or_not_found(&package_id)? .as_store_mut(); let mut model_value = model.de()?; + if model_value.is_null() { + model_value = json!({}); + } path.set(&mut model_value, value, true) .with_kind(ErrorKind::ParseDbField)?; model.ser(&model_value) diff --git a/sdk/lib/inits/setupInit.ts b/sdk/lib/inits/setupInit.ts index 7d4586ef1..9139de23b 100644 --- a/sdk/lib/inits/setupInit.ts +++ b/sdk/lib/inits/setupInit.ts @@ -32,7 +32,7 @@ export function setupInit( utils, }) await opts.effects.exposeForDependents(services) - await opts.effects.exposeUi(ui) + await opts.effects.exposeUi({ paths: ui }) }, uninit: async (opts) => { await migrations.uninit(opts) diff --git a/sdk/lib/types.ts b/sdk/lib/types.ts index a53b3d273..335372d6c 100644 --- a/sdk/lib/types.ts +++ b/sdk/lib/types.ts @@ -372,7 +372,9 @@ export type Effects = { options: ExposeServicePaths, ): Promise - exposeUi(options: ExposeUiPaths): Promise + exposeUi(options: { + paths: ExposeUiPaths + }): Promise /** * There are times that we want to see the addresses that where exported * @param options.addressId If we want to filter the address id