Skip to content

Commit

Permalink
fix(app-module): faiilover when meta.id is not set. vite proxy handle…
Browse files Browse the repository at this point in the history
…s manifest only
  • Loading branch information
eikeland committed Nov 19, 2024
1 parent b763e9b commit 9b8fa59
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions packages/cli/src/lib/plugins/app-proxy/app-proxy-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion packages/modules/app/src/app/App.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down

0 comments on commit 9b8fa59

Please sign in to comment.