diff --git a/home/apps/profile/matrix.json b/home/apps/profile/matrix.json index d54e61f8f..83dba07d4 100644 --- a/home/apps/profile/matrix.json +++ b/home/apps/profile/matrix.json @@ -3,6 +3,7 @@ "description": "Your Matrix profile page", "runtime": "vite", "category": "social", + "icon": "profile", "version": "1.0.0", "slug": "profile", "runtimeVersion": "^1.0.0", diff --git a/shell/src/lib/error-boundary-utils.ts b/shell/src/lib/error-boundary-utils.ts index 9e6398bda..3d179272a 100644 --- a/shell/src/lib/error-boundary-utils.ts +++ b/shell/src/lib/error-boundary-utils.ts @@ -16,7 +16,8 @@ export function describeUnknownError(error: unknown): string { if (error instanceof globalThis.Error) return `${error.name}: ${error.message}`; try { return String(error); - } catch { + } catch (stringifyError) { + void stringifyError; return typeof error; } } diff --git a/tests/gateway/apps.test.ts b/tests/gateway/apps.test.ts index 5f7b52b42..0a8d61cd9 100644 --- a/tests/gateway/apps.test.ts +++ b/tests/gateway/apps.test.ts @@ -262,7 +262,7 @@ describe("T711: GET /api/apps", () => { expect(names).toContain("Timer"); }); - it("ships icons for every default app manifest", () => { + it("requires every default app manifest to declare a shipped icon", () => { const repoRoot = resolve(fileURLToPath(new URL("../..", import.meta.url))); const appsRoot = join(repoRoot, "home/apps"); const iconsRoot = join(repoRoot, "home/system/icons"); @@ -287,7 +287,9 @@ describe("T711: GET /api/apps", () => { continue; } const manifest = JSON.parse(readFileSync(fullPath, "utf8")) as { icon?: unknown }; - if (typeof manifest.icon === "string" && !shippedIcons.has(manifest.icon)) { + if (typeof manifest.icon !== "string") { + missing.push(`${fullPath.replace(`${repoRoot}/`, "")}: missing icon`); + } else if (!shippedIcons.has(manifest.icon)) { missing.push(`${fullPath.replace(`${repoRoot}/`, "")}: ${manifest.icon}`); } } diff --git a/tests/shell/error-boundary-utils.test.ts b/tests/shell/error-boundary-utils.test.ts new file mode 100644 index 000000000..8e3af142a --- /dev/null +++ b/tests/shell/error-boundary-utils.test.ts @@ -0,0 +1,15 @@ +import { describe, expect, it } from "vitest"; + +import { describeUnknownError } from "../../shell/src/lib/error-boundary-utils"; + +describe("describeUnknownError", () => { + it("falls back to the original value type when string coercion throws", () => { + const errorLikeValue = { + [Symbol.toPrimitive]() { + throw new TypeError("string coercion failed"); + }, + }; + + expect(describeUnknownError(errorLikeValue)).toBe("object"); + }); +});