From 535215bfd1fee6087613108f42d28cd2807184d3 Mon Sep 17 00:00:00 2001 From: Adam Malczewski Date: Sat, 5 Sep 2026 05:20:01 +0900 Subject: fix(layout): guard plugin-host sync against malformed /plugins list; fix App test fake --- src/app/plugin-host.svelte.ts | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/app/plugin-host.svelte.ts') diff --git a/src/app/plugin-host.svelte.ts b/src/app/plugin-host.svelte.ts index 9e53bc1..729a8aa 100644 --- a/src/app/plugin-host.svelte.ts +++ b/src/app/plugin-host.svelte.ts @@ -122,6 +122,12 @@ export function createPluginHost(opts: PluginHostOptions): PluginHost { opts.http.workspacePlugins(workspaceId), ]); if (list === null) return; + // Shape guard at the outermost edge (asymmetric testing: the shell + // guards, the pure diff stays trusting): a malformed-but-200 + // `/plugins` response (wrong shape, contract drift, a test fake that + // doesn't model the route) must fail SOFT exactly like `null` — keep + // the current imported set, never throw from the fire-and-forget sync. + if (!Array.isArray(list.loaded)) return; const candidates = frontendCandidates(list, { workspaceId, usableIds: usablePluginIds(workspace?.plugins ?? []), -- cgit v1.2.3