From 9b8fa598559b1cc6dfd993b988cd396da5087e0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20Eikeland?= Date: Tue, 19 Nov 2024 10:33:52 +0100 Subject: [PATCH] fix(app-module): faiilover when meta.id is not set. vite proxy handles manifest only --- packages/cli/src/lib/plugins/app-proxy/app-proxy-plugin.ts | 7 +++---- packages/modules/app/src/app/App.ts | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/packages/cli/src/lib/plugins/app-proxy/app-proxy-plugin.ts b/packages/cli/src/lib/plugins/app-proxy/app-proxy-plugin.ts index b90efc1de..b2743e775 100644 --- a/packages/cli/src/lib/plugins/app-proxy/app-proxy-plugin.ts +++ b/packages/cli/src/lib/plugins/app-proxy/app-proxy-plugin.ts @@ -160,19 +160,18 @@ export const appProxyPlugin = (options: AppProxyPluginOptions): Plugin => { res.end(JSON.stringify(await app.generateConfig())); }); - // TODO: AppSettings should be saved in memory localy // serve app manifest if request matches the current app const manifestPath = join(proxyPath, app.manifestPath ?? `apps/${app.key}`); server.middlewares.use(async (req, res, next) => { // We only want to match the exact path - console.log(req.url); const [requestPath] = (req.url ?? '').split('?'); if (requestPath === manifestPath) { res.setHeader('content-type', 'application/json'); res.end(JSON.stringify(await app.generateManifest())); - } else { - next(); + return; } + + next(); }); // serve local bundles if request matches the current app and version diff --git a/packages/modules/app/src/app/App.ts b/packages/modules/app/src/app/App.ts index 5e3749d80..83d947364 100644 --- a/packages/modules/app/src/app/App.ts +++ b/packages/modules/app/src/app/App.ts @@ -687,7 +687,7 @@ export class App< const updateActions$ = this.#state.action$.pipe( // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore - filter((a) => action.meta.id === a.meta.id), + filter((a) => action.meta.id === a.meta?.id), ); return new Observable((subscriber) => {