diff --git a/src/server/AppManager.ts b/src/server/AppManager.ts index 11709c6c0..c549f84a8 100644 --- a/src/server/AppManager.ts +++ b/src/server/AppManager.ts @@ -960,6 +960,10 @@ export class AppManager { result = false; await app.setStatus(status, silenceStatus); + + // If some error has happened in initialization, like license or installations invalidation + // we need to store this on the DB regardless of what the parameter requests + saveToDb = true; } if (saveToDb) { @@ -1038,6 +1042,10 @@ export class AppManager { } console.error(e); + + // If some error has happened during enabling, like license or installations invalidation + // we need to store this on the DB regardless of what the parameter requests + saveToDb = true; } if (enable) { diff --git a/src/server/runtime/deno/AppsEngineDenoRuntime.ts b/src/server/runtime/deno/AppsEngineDenoRuntime.ts index 6f9e55ae3..42689fc25 100644 --- a/src/server/runtime/deno/AppsEngineDenoRuntime.ts +++ b/src/server/runtime/deno/AppsEngineDenoRuntime.ts @@ -12,7 +12,7 @@ import type { AppBridges } from '../../bridges'; import type { IParseAppPackageResult } from '../../compiler'; import { AppConsole, type ILoggerStorageEntry } from '../../logging'; import type { AppAccessorManager, AppApiManager } from '../../managers'; -import { AppStatus } from '../../../definition/AppStatus'; +import { AppStatus, AppStatusUtils } from '../../../definition/AppStatus'; import type { AppMethod } from '../../../definition/metadata'; import { bundleLegacyApp } from './bundler'; import { ProcessMessenger } from './ProcessMessenger'; @@ -294,6 +294,10 @@ export class DenoRuntimeSubprocessController extends EventEmitter { await this.sendRequest({ method: 'app:initialize' }); await this.sendRequest({ method: 'app:setStatus', params: [status] }); + if (AppStatusUtils.isEnabled(this.storageItem.status)) { + await this.sendRequest({ method: 'app:onEnable' }); + } + this.state = 'ready'; logger.info('Successfully restarted app subprocess');