From cb3dd2fcace3a1b7481e64599c5d9888ba072f6a Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Sat, 7 Nov 2026 09:56:20 -0800 Subject: [PATCH 1/4] chore(quest): claim quest/m0/favorite-presence.md Quest-Claim: 1638360278e90c5c From 9c13d05752438ff642231f38744bd099a5531be1 Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Sat, 7 Nov 2026 10:05:39 -0800 Subject: [PATCH 2/4] fix: scope favorite presence and clear badge totals --- app/bunfig.toml | 2 + app/package.json | 13 ++- app/src/components/badge.test.ts | 58 ++++++++++++ app/src/components/badge.ts | 24 ++--- app/src/home.test.ts | 148 +++++++++++++++++++++++++++++++ app/src/home.tsx | 6 +- app/src/preview.tsx | 2 +- app/test/setup.ts | 20 +++++ app/tsconfig.json | 2 +- bun.lock | 77 ++++++++++++++-- quest/m0/README.md | 1 - quest/m0/favorite-presence.md | 23 ----- 12 files changed, 326 insertions(+), 50 deletions(-) create mode 100644 app/bunfig.toml create mode 100644 app/src/components/badge.test.ts create mode 100644 app/src/home.test.ts create mode 100644 app/test/setup.ts delete mode 100644 quest/m0/favorite-presence.md diff --git a/app/bunfig.toml b/app/bunfig.toml new file mode 100644 index 00000000..8755352e --- /dev/null +++ b/app/bunfig.toml @@ -0,0 +1,2 @@ +[test] +preload = ["./test/setup.ts"] diff --git a/app/package.json b/app/package.json index e010a934..0c872227 100644 --- a/app/package.json +++ b/app/package.json @@ -11,7 +11,7 @@ "deps": "bun run --cwd ../api build && bun run --cwd ../moq/js/libav build", "fix": "biome check --fix", "tauri": "tauri", - "test": "bun test src/room/metadata.test.ts" + "test": "bun test --isolate --conditions=browser src" }, "license": "MIT", "dependencies": { @@ -48,15 +48,22 @@ "@moq/clock": "workspace:*" }, "devDependencies": { + "@babel/core": "7.29.7", + "@babel/preset-typescript": "^7.29.0", "@biomejs/biome": "^2.4.3", + "@happy-dom/global-registrator": "21.0.4", "@iconify-json/material-symbols": "^1.2.33", "@iconify-json/mdi": "^1.2.3", "@iconify/tailwind4": "^1.0.6", "@tailwindcss/typography": "^0.5.16", "@tauri-apps/cli": "^2.8.4", + "@types/babel__core": "7.20.5", + "@types/bun": "^1.4.0", "@typescript/lib-dom": "npm:@types/web@^0.0.345", + "babel-preset-solid": "1.9.15", "globals": "^17.4.0", "madge": "^8.0.0", + "rolldown": "^1.2.15", "ts-expect": "^1.3.0", "tsx": "^4.20.5", "typescript": "^6.0.0", @@ -65,9 +72,7 @@ "vite-plugin-solid": "^2.11.8", "vite-plugin-static-copy": "^4.0.0", "vite-plugin-wrangler": "^0.1.1", - "wrangler": "^4.33.0", - "@types/bun": "^1.4.0", - "rolldown": "^1.2.15" + "wrangler": "^4.33.0" }, "packageManager": "bun@1.4.2" } diff --git a/app/src/components/badge.test.ts b/app/src/components/badge.test.ts new file mode 100644 index 00000000..9a16348c --- /dev/null +++ b/app/src/components/badge.test.ts @@ -0,0 +1,58 @@ +import { afterEach, expect, mock, test } from "bun:test"; + +mock.module("../tauri", () => ({ Api: null })); +const { Badge } = await import("./badge"); +const setDescriptor = Object.getOwnPropertyDescriptor(navigator, "setAppBadge"); +const clearDescriptor = Object.getOwnPropertyDescriptor(navigator, "clearAppBadge"); +let badge: InstanceType | undefined; + +async function flush() { + for (let i = 0; i < 30; i++) await Promise.resolve(); +} + +afterEach(async () => { + badge?.close(); + badge = undefined; + await flush(); + if (setDescriptor) Object.defineProperty(navigator, "setAppBadge", setDescriptor); + else Reflect.deleteProperty(navigator, "setAppBadge"); + if (clearDescriptor) Object.defineProperty(navigator, "clearAppBadge", clearDescriptor); + else Reflect.deleteProperty(navigator, "clearAppBadge"); +}); + +test("closing a badge clears it after its pending update and before a new owner's update", async () => { + const calls: (number | "clear")[] = []; + let release: (() => void) | undefined; + Object.defineProperty(navigator, "setAppBadge", { + configurable: true, + value: async (count: number) => { + calls.push(count); + if (count === 2) + await new Promise((resolve) => { + release = resolve; + }); + }, + }); + Object.defineProperty(navigator, "clearAppBadge", { + configurable: true, + value: async () => { + calls.push("clear"); + }, + }); + badge = new Badge(); + badge.set(2); + await flush(); + expect(calls).toEqual([2]); + badge.close(); + badge = new Badge(); + badge.set(1); + await flush(); + expect(calls).toEqual([2]); + if (!release) throw new Error("Missing pending badge operation"); + release(); + await flush(); + expect(calls).toEqual([2, "clear", 1]); + badge.close(); + await flush(); + expect(calls).toEqual([2, "clear", 1, "clear"]); +}); diff --git a/app/src/components/badge.ts b/app/src/components/badge.ts index 89b04f89..c087fb78 100644 --- a/app/src/components/badge.ts +++ b/app/src/components/badge.ts @@ -1,8 +1,10 @@ -let lock = false; - import * as Tauri from "../tauri"; -async function set(count: number | undefined) { +let lock = false; +// A closed owner's pending writes must finish before the next owner's writes. +let pending = Promise.resolve(); + +async function set(count: number): Promise { if (Tauri.Api) { const success = await Tauri.Api.window .getCurrentWindow() @@ -12,9 +14,8 @@ async function set(count: number | undefined) { if (success) return; } - if (navigator.setAppBadge) { - const success = await navigator - .setAppBadge(count || undefined) + if (count ? navigator.setAppBadge : navigator.clearAppBadge) { + const success = await (count ? navigator.setAppBadge(count) : navigator.clearAppBadge()) .then(() => true) .catch(() => false); if (success) return; @@ -34,7 +35,7 @@ async function set(count: number | undefined) { export class Badge { private current: number = 0; - #p?: Promise = Promise.resolve(); + #closed = false; constructor() { if (lock) throw new Error("Badge is already locked"); @@ -50,9 +51,9 @@ export class Badge { * @param count - The number to display on the badge, or 0 to clear */ set(count: number): void { + if (this.#closed) throw new Error("closed"); this.current = count; - if (!this.#p) throw new Error("closed"); - this.#p = this.#p.then(() => set(count)); + pending = pending.then(() => set(count)); } /** @@ -72,8 +73,9 @@ export class Badge { } close() { - this.current = 0; - this.#p = undefined; + if (this.#closed) return; + this.set(0); + this.#closed = true; lock = false; } } diff --git a/app/src/home.test.ts b/app/src/home.test.ts new file mode 100644 index 00000000..531f33bf --- /dev/null +++ b/app/src/home.test.ts @@ -0,0 +1,148 @@ +import { afterEach, expect, mock, test } from "bun:test"; +import * as Json from "@moq/json"; +import * as Moq from "@moq/net"; +import { Signal } from "@moq/signals"; +import type { JSX } from "solid-js"; +import { render } from "solid-js/web"; + +// Exercise the real Home, favorite cards, and preview rosters without API or relay I/O. +const origin = new Moq.Origin.Producer(); +const connection = new Moq.Connection({ enabled: false }); +Object.defineProperty(connection, "origin", { value: new Signal(origin) }); +const authenticated = new Signal(true); +let favorites = [ + { room: "room", created_at: 0 }, + { room: "roommate", created_at: 0 }, +]; +const badgeCounts: (number | undefined)[] = []; +Object.defineProperty(navigator, "setAppBadge", { + configurable: true, + value: async (count?: number) => { + badgeCounts.push(count); + }, +}); +const clearBadge = mock(async () => { + badgeCounts.push(undefined); +}); +Object.defineProperty(navigator, "clearAppBadge", { + configurable: true, + value: clearBadge, +}); + +mock.module("./api", () => ({ + client: { + authenticated, + routes: { + fave: { + all: { $get: async () => ({ ok: true, json: async () => ({ favorites }) }) }, + ":room": { + remove: { + $post: async ({ param }: { param: { room: string } }) => { + favorites = favorites.filter((favorite) => favorite.room !== param.room); + return { ok: true }; + }, + }, + }, + }, + }, + }, +})); +mock.module("./components/create", () => ({ default: () => null })); +mock.module("./components/login", () => ({ default: () => null })); +mock.module("./components/profile", () => ({ default: () => null })); +mock.module("./layout/web", () => ({ default: (props: { children: JSX.Element }) => props.children })); +mock.module("./room/local", () => ({ + Local: class { + close() {} + }, +})); +mock.module("./tauri", () => ({ Api: null })); +mock.module("../../moq/js/watch/src/audio/render-worklet.ts?worklet", () => ({ + default: async () => "blob:fake-render", +})); +mock.module("../../moq/js/publish/src/audio/capture-worklet.ts?worklet", () => ({ + default: async () => "blob:fake-capture", +})); +mock.module("../../moq/js/publish/src/video/capture-worker.ts?worklet", () => ({ + default: async () => "blob:fake-worker", +})); + +// Keep a real Connection (and its complete type), but supply the in-memory origin. +const originalConnection = Moq.Connection; +mock.module("@moq/net", () => ({ + ...Moq, + Connection: class extends originalConnection { + constructor() { + super({ enabled: false }); + Object.defineProperty(this, "origin", { value: connection.origin }); + } + }, +})); +const { Home } = await import("./home"); + +// MoQ notifications and Solid resource/effect work settle through microtasks. +async function flush() { + for (let i = 0; i < 50; i++) await Promise.resolve(); +} + +const routes: Moq.Origin.Route[] = []; +const catalogs: Json.Snapshot.Producer[] = []; +function announce(path: string): Moq.Origin.Route { + const route = origin.route(Moq.Path.from(path), { hidden: true }); + const catalog = new Json.Snapshot.Producer({ track: route.broadcast.createTrack("catalog.json") }); + catalog.update({ value: {} }); + catalogs.push(catalog); + routes.push(route); + route.announce(); + return route; +} +let dispose: (() => void) | undefined; +afterEach(async () => { + dispose?.(); + dispose = undefined; + for (const catalog of catalogs) catalog.finish(); + for (const route of routes) route.close(); + origin.close(); + connection.close(); + await flush(); + document.body.replaceChildren(); +}); + +test("favorites scope sibling rooms and balance the badge through joins, leaves, removal, and disposal", async () => { + const element = document.createElement("div"); + document.body.append(element); + dispose = render(Home, element); + await flush(); + const roomRoute = announce("room/alice/camera.hang"); + await flush(); + const cards = () => [...element.querySelectorAll("a[href^='/@']")].map((link) => link.parentElement?.parentElement); + const counts = () => cards().map((card) => card?.querySelector("span.text-gray-400")?.textContent ?? "0"); + expect(counts()).toEqual(["1", "0"]); + expect(badgeCounts.at(-1)).toBe(1); + + announce("roommate/bob/camera.hang"); + await flush(); + expect(counts()).toEqual(["1", "1"]); + expect(badgeCounts.at(-1)).toBe(2); + + roomRoute.close(); + await flush(); + expect(counts()).toEqual(["0", "1"]); + expect(badgeCounts.at(-1)).toBe(1); + + const remove = cards()[1]?.querySelector("button"); + if (!remove) throw new Error("Missing favorite remove button"); + remove.click(); + await flush(); + expect(cards()).toHaveLength(1); + expect(badgeCounts.at(-1)).toBeUndefined(); + expect(clearBadge).toHaveBeenCalled(); + + announce("room/carol/camera.hang"); + await flush(); + expect(badgeCounts.at(-1)).toBe(1); + dispose(); + dispose = undefined; + await flush(); + expect(badgeCounts.at(-1)).toBeUndefined(); +}); diff --git a/app/src/home.tsx b/app/src/home.tsx index 5061f088..9cad47b1 100644 --- a/app/src/home.tsx +++ b/app/src/home.tsx @@ -171,9 +171,9 @@ function FavoriteRoom(props: { createEffect(() => { const count = memberCount(); props.badge.increment(count); - return () => { + onCleanup(() => { props.badge.decrement(count); - }; + }); }); const handleRemove = async (e: MouseEvent) => { @@ -216,7 +216,7 @@ function FavoriteRoom(props: { - + ); } diff --git a/app/src/preview.tsx b/app/src/preview.tsx index 97e5cc9d..3e18c324 100644 --- a/app/src/preview.tsx +++ b/app/src/preview.tsx @@ -1,6 +1,6 @@ import * as Moq from "@moq/net"; import { createAccessor as solid } from "@moq/signals/solid"; -import { createEffect, For, onCleanup, Setter, Show } from "solid-js"; +import { createEffect, For, onCleanup, type Setter, Show } from "solid-js"; import type { JSX } from "solid-js/jsx-runtime"; import * as Preview from "./room/preview"; diff --git a/app/test/setup.ts b/app/test/setup.ts new file mode 100644 index 00000000..15c19672 --- /dev/null +++ b/app/test/setup.ts @@ -0,0 +1,20 @@ +import * as Babel from "@babel/core"; +import { GlobalRegistrator } from "@happy-dom/global-registrator"; +import * as Bun from "bun"; + +GlobalRegistrator.register(); + +// Match Vite's Solid JSX transform while running component tests in Bun. +await Bun.plugin({ + name: "solid-test", + setup(build) { + build.onLoad({ filter: /\.tsx$/ }, async ({ path }) => { + const result = Babel.transformSync(await Bun.file(path).text(), { + filename: path, + presets: [import.meta.resolve("babel-preset-solid"), import.meta.resolve("@babel/preset-typescript")], + }); + if (!result?.code) throw new Error(`Failed to transform ${path}`); + return { contents: result.code, loader: "js" }; + }); + }, +}); diff --git a/app/tsconfig.json b/app/tsconfig.json index 8a882114..dca0a5e2 100644 --- a/app/tsconfig.json +++ b/app/tsconfig.json @@ -15,5 +15,5 @@ "resolveJsonModule": true, "types": ["vite/client", "vite-plugin-glsl/ext", "bun"] }, - "include": ["src", "../moq/js/common/worklet.d.ts"] + "include": ["src", "test/setup.ts", "../moq/js/common/worklet.d.ts"] } diff --git a/bun.lock b/bun.lock index 1b5acd95..1d59fde8 100644 --- a/bun.lock +++ b/bun.lock @@ -70,14 +70,19 @@ "zod": "^4.1.3", }, "devDependencies": { + "@babel/core": "7.29.7", + "@babel/preset-typescript": "^7.29.0", "@biomejs/biome": "^2.4.3", + "@happy-dom/global-registrator": "21.0.4", "@iconify-json/material-symbols": "^1.2.33", "@iconify-json/mdi": "^1.2.3", "@iconify/tailwind4": "^1.0.6", "@tailwindcss/typography": "^0.5.16", "@tauri-apps/cli": "^2.8.4", + "@types/babel__core": "7.20.5", "@types/bun": "^1.4.0", "@typescript/lib-dom": "npm:@types/web@^0.0.345", + "babel-preset-solid": "1.9.15", "globals": "^17.4.0", "madge": "^8.0.0", "rolldown": "^1.2.15", @@ -364,16 +369,28 @@ "@babel/generator": ["@babel/generator@7.29.8", "", { "dependencies": { "@babel/parser": "^7.29.8", "@babel/types": "^7.29.8", "@jridgewell/gen-mapping": "^0.3.12", "@jridgewell/trace-mapping": "^0.3.28", "jsesc": "^3.0.2" } }, "sha512-gZbepsdh3WDtgZKWL+vTPh71LSBrm/Y4/QDZBVCcYfmeTEEuoOYwlSy+G1StfJg+/Zy550u/3TATbm7qDbbMtg=="], + "@babel/helper-annotate-as-pure": ["@babel/helper-annotate-as-pure@7.29.7", "", { "dependencies": { "@babel/types": "^7.29.7" } }, "sha512-OoK6239jHPuSQOoS0kfTVKn0b/rVTk0seKq4Gd2UMLtmOVLjDC0ki3e+c90Trqv2gMfvJFqkiljrr568+qddiw=="], + "@babel/helper-compilation-targets": ["@babel/helper-compilation-targets@7.29.7", "", { "dependencies": { "@babel/compat-data": "^7.29.7", "@babel/helper-validator-option": "^7.29.7", "browserslist": "^4.24.0", "lru-cache": "^5.1.1", "semver": "^6.3.1" } }, "sha512-wem6WaBj4NaVYVdNhLPPVacES6ZJ+KBBfSkTMD3YZxbP3rm3Di85tJU5ljaUNhaOynt+Aj0xruhYuzQBt8n71g=="], + "@babel/helper-create-class-features-plugin": ["@babel/helper-create-class-features-plugin@7.29.13", "", { "dependencies": { "@babel/helper-annotate-as-pure": "^7.29.7", "@babel/helper-member-expression-to-functions": "^7.29.7", "@babel/helper-optimise-call-expression": "^7.29.7", "@babel/helper-replace-supers": "^7.29.7", "@babel/helper-skip-transparent-expression-wrappers": "^7.29.13", "@babel/traverse": "^7.29.13", "semver": "^6.3.1" }, "peerDependencies": { "@babel/core": "^7.0.0" } }, "sha512-fo8/Fr44/DMV71FQjk/HA0Npmu3bo5DFoWTCW1dhUR8Vx3NFfAVeEy0TbcBpt4e+hd2QhdmWgmspHo/9iWj8RA=="], + "@babel/helper-globals": ["@babel/helper-globals@7.29.7", "", {}, "sha512-3nQVUAtvkKH9zahfWgw96Jc/uFOmjACE1kQz82E2lqWmHBgjzbNlsC22nuQTfahmWeQtTq5nQ/4Nnd2A1wj4zA=="], + "@babel/helper-member-expression-to-functions": ["@babel/helper-member-expression-to-functions@7.29.7", "", { "dependencies": { "@babel/traverse": "^7.29.7", "@babel/types": "^7.29.7" } }, "sha512-j+7JYmk1JYDtACIGj0QJqqWZjoUpMoEikQGADMaHgCMCSDqd2+P32rfcibUNrGOMWrlzK1WJBdxrB3JJQZwWtg=="], + "@babel/helper-module-imports": ["@babel/helper-module-imports@7.29.7", "", { "dependencies": { "@babel/traverse": "^7.29.7", "@babel/types": "^7.29.7" } }, "sha512-ejHwrQQYcm9xnTivShn2IDOlIzInN34AXskvq9QicvCtEzq1Vzclu/tKF8Jq1Cg8JG2GL6/EmjgsCT7lXepE3g=="], "@babel/helper-module-transforms": ["@babel/helper-module-transforms@7.29.7", "", { "dependencies": { "@babel/helper-module-imports": "^7.29.7", "@babel/helper-validator-identifier": "^7.29.7", "@babel/traverse": "^7.29.7" }, "peerDependencies": { "@babel/core": "^7.0.0" } }, "sha512-UPUVSyXbOh627KiCIGQSgwWzGeBKLkaJ9PJEdrngIwMSzxLR4jS4+f1f1jb7VzBbg8nFLaYotvVPFCTqdrmTAg=="], + "@babel/helper-optimise-call-expression": ["@babel/helper-optimise-call-expression@7.29.7", "", { "dependencies": { "@babel/types": "^7.29.7" } }, "sha512-+kmGVjcT9RGYzoDwdwEqEvGgKe3BYq+O1iGzjFubaNgZHwYHP6lsF2Yghf4kEuv9BV7tYDZ913aBW9am6YKong=="], + "@babel/helper-plugin-utils": ["@babel/helper-plugin-utils@7.29.7", "", {}, "sha512-G7sHYigPY17oO5SYWnfD/0MTBwVR781S/JI643e/JhUYgVgWE/61SoW3NH9KWUKyKq5LVh3npif99Wkt6j86Jw=="], + "@babel/helper-replace-supers": ["@babel/helper-replace-supers@7.29.7", "", { "dependencies": { "@babel/helper-member-expression-to-functions": "^7.29.7", "@babel/helper-optimise-call-expression": "^7.29.7", "@babel/traverse": "^7.29.7" }, "peerDependencies": { "@babel/core": "^7.0.0" } }, "sha512-atfGXWSeCiF4DnKZIfmJfQRkSw9b9gNNXR1kqKjbhG4pGYCOnkp8OcTB8E3NXjBu8NpheSnOeNKz8KT7UNFTmQ=="], + + "@babel/helper-skip-transparent-expression-wrappers": ["@babel/helper-skip-transparent-expression-wrappers@7.29.13", "", { "dependencies": { "@babel/traverse": "^7.29.13", "@babel/types": "^7.29.11" } }, "sha512-Abm4rKIH0tmCayJLwcoeOkdzpYUphTbO52fHhyEBHn7S0R+ni4epNLI/8nq1L0DN2Bl0u5qmgWm2Og/z4fBb+Q=="], + "@babel/helper-string-parser": ["@babel/helper-string-parser@7.29.7", "", {}, "sha512-Pb5ijPrZ89GDH8223L4UP8i6QApWxs04RbPQJTeWDV0/keR2E36MeKnyr6LYmUUvqRRI+Iv87SuF1W6ErINzYw=="], "@babel/helper-validator-identifier": ["@babel/helper-validator-identifier@7.29.7", "", {}, "sha512-qehxGkRj55h/ff8EMaJ+cYhyaKlHIxqYDn682wQD7RNp9UujOQsHog2uS0r2vzr4pW+sXf90NeeayjcNaX3fFg=="], @@ -386,6 +403,14 @@ "@babel/plugin-syntax-jsx": ["@babel/plugin-syntax-jsx@7.29.7", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.29.7" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-TSu8+mHCoEaaCDEZ0I3+6mvTBYR4PCxQwf2z9/r5Tbztv6NaLR3B9thGTTxX2WGuGHJqRiAbKPeGTJ5XWXVg6A=="], + "@babel/plugin-syntax-typescript": ["@babel/plugin-syntax-typescript@7.29.7", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.29.7" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-ngr+82Sh0xMz25TPCZi+nC2iTzjfCdWS2ONXTp/PtSCHCgaCNBpdMqgvJ2ccdLlClVZ7sisIgB914j/JFe+RZA=="], + + "@babel/plugin-transform-modules-commonjs": ["@babel/plugin-transform-modules-commonjs@7.29.7", "", { "dependencies": { "@babel/helper-module-transforms": "^7.29.7", "@babel/helper-plugin-utils": "^7.29.7" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-j0vCldybPC5b5dwCQOJ21uKtHzt7hxLygJTg9eF1ScfaikEDNfzn94XoW5Fi+seBR0nCyL23xaBFFkq7dTM8XQ=="], + + "@babel/plugin-transform-typescript": ["@babel/plugin-transform-typescript@7.29.9", "", { "dependencies": { "@babel/helper-annotate-as-pure": "^7.29.7", "@babel/helper-create-class-features-plugin": "^7.29.7", "@babel/helper-plugin-utils": "^7.29.7", "@babel/helper-skip-transparent-expression-wrappers": "^7.29.7", "@babel/plugin-syntax-typescript": "^7.29.7" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-FFwIwzU+7SCOuxxV4YtJql6T9981ZVTm+FHO5GhVsRqCTdy0WwrEZh3l42ARpXruJUDGOptdduHW6Zr7pNPLNg=="], + + "@babel/preset-typescript": ["@babel/preset-typescript@7.29.7", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.29.7", "@babel/helper-validator-option": "^7.29.7", "@babel/plugin-syntax-jsx": "^7.29.7", "@babel/plugin-transform-modules-commonjs": "^7.29.7", "@babel/plugin-transform-typescript": "^7.29.7" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-/Foi8vKY2EVbed/1eZx0gJEEwHAIxogrySI7rULcRIvhZzbvoE/b5qG5Ghc0WKAFKOHA9SD1x7RsFlOYdutIiQ=="], + "@babel/template": ["@babel/template@7.29.7", "", { "dependencies": { "@babel/code-frame": "^7.29.7", "@babel/parser": "^7.29.7", "@babel/types": "^7.29.7" } }, "sha512-puq+Gf35oI24FeN11LkoUQFqv9uwNeWpxXZi/Ji3rRIoKAzKnxRaZ+Gkj0vKS9ZCiTESfng1N9LyOyXvo+m+Gg=="], "@babel/traverse": ["@babel/traverse@7.29.8", "", { "dependencies": { "@babel/code-frame": "^7.29.7", "@babel/generator": "^7.29.8", "@babel/helper-globals": "^7.29.7", "@babel/parser": "^7.29.8", "@babel/template": "^7.29.7", "@babel/types": "^7.29.8", "debug": "^4.3.1" } }, "sha512-I5z7H3bf/41ktsNVLtpN0wAa336HkqIHQ5BuPLEhTkt1jVSyZpeNKIzTgEWmlxjdg81R0IgUCcaE+Ok3NvrfZg=="], @@ -584,7 +609,7 @@ "@jridgewell/sourcemap-codec": ["@jridgewell/sourcemap-codec@1.6.0", "", {}, "sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw=="], - "@jridgewell/trace-mapping": ["@jridgewell/trace-mapping@0.3.9", "", { "dependencies": { "@jridgewell/resolve-uri": "^3.0.3", "@jridgewell/sourcemap-codec": "^1.4.10" } }, "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ=="], + "@jridgewell/trace-mapping": ["@jridgewell/trace-mapping@0.3.31", "", { "dependencies": { "@jridgewell/resolve-uri": "^3.1.0", "@jridgewell/sourcemap-codec": "^1.4.14" } }, "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw=="], "@kixelated/libavjs-webcodecs-polyfill": ["@kixelated/libavjs-webcodecs-polyfill@0.5.6", "", { "dependencies": { "@libav.js/types": "^6.7.7", "@ungap/global-this": "^0.4.4" } }, "sha512-A6FBsEAT/t0cDDaxo3h5XabiHX2RtycQbWV+MNKUghmctrXU1ygl05i3TTtnSF/eLmCLLO8xBMrXO+eGnpLWFw=="], @@ -1448,7 +1473,21 @@ "zod": ["zod@4.6.7", "", {}, "sha512-g8W2D2kU6a8untc053fX1uVBKzM7yqAxW/3zwk83+6RyF2+SKOuV+c0wBDhUwzV1PaGapmZH+rmcUzPf+3CGwg=="], - "@babel/generator/@jridgewell/trace-mapping": ["@jridgewell/trace-mapping@0.3.31", "", { "dependencies": { "@jridgewell/resolve-uri": "^3.1.0", "@jridgewell/sourcemap-codec": "^1.4.14" } }, "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw=="], + "@babel/helper-create-class-features-plugin/@babel/traverse": ["@babel/traverse@7.29.13", "", { "dependencies": { "@babel/code-frame": "^7.29.7", "@babel/generator": "^7.29.13", "@babel/helper-globals": "^7.29.7", "@babel/parser": "^7.29.13", "@babel/template": "^7.29.7", "@babel/types": "^7.29.11", "debug": "^4.3.1" } }, "sha512-0ve0xMlFA73dgY1oyJRY6RoW+/bncdcOQqg6jjYcVfXBK90OdLXjm9R6lmRetdZVrPjXkKIoMVBqYFPjcAlZ4Q=="], + + "@babel/helper-member-expression-to-functions/@babel/traverse": ["@babel/traverse@7.29.13", "", { "dependencies": { "@babel/code-frame": "^7.29.7", "@babel/generator": "^7.29.13", "@babel/helper-globals": "^7.29.7", "@babel/parser": "^7.29.13", "@babel/template": "^7.29.7", "@babel/types": "^7.29.11", "debug": "^4.3.1" } }, "sha512-0ve0xMlFA73dgY1oyJRY6RoW+/bncdcOQqg6jjYcVfXBK90OdLXjm9R6lmRetdZVrPjXkKIoMVBqYFPjcAlZ4Q=="], + + "@babel/helper-member-expression-to-functions/@babel/types": ["@babel/types@7.29.11", "", { "dependencies": { "@babel/helper-string-parser": "^7.29.11", "@babel/helper-validator-identifier": "^7.29.7" } }, "sha512-WCsemW40Cpc6gouC1SrY6PBaZ+oLRlEVY9XBvZBI7il/HyUrb2nJ505wE1MHEFyDZNnrWDEuy4jL50WVHfTTSQ=="], + + "@babel/helper-optimise-call-expression/@babel/types": ["@babel/types@7.29.11", "", { "dependencies": { "@babel/helper-string-parser": "^7.29.11", "@babel/helper-validator-identifier": "^7.29.7" } }, "sha512-WCsemW40Cpc6gouC1SrY6PBaZ+oLRlEVY9XBvZBI7il/HyUrb2nJ505wE1MHEFyDZNnrWDEuy4jL50WVHfTTSQ=="], + + "@babel/helper-replace-supers/@babel/traverse": ["@babel/traverse@7.29.13", "", { "dependencies": { "@babel/code-frame": "^7.29.7", "@babel/generator": "^7.29.13", "@babel/helper-globals": "^7.29.7", "@babel/parser": "^7.29.13", "@babel/template": "^7.29.7", "@babel/types": "^7.29.11", "debug": "^4.3.1" } }, "sha512-0ve0xMlFA73dgY1oyJRY6RoW+/bncdcOQqg6jjYcVfXBK90OdLXjm9R6lmRetdZVrPjXkKIoMVBqYFPjcAlZ4Q=="], + + "@babel/helper-skip-transparent-expression-wrappers/@babel/traverse": ["@babel/traverse@7.29.13", "", { "dependencies": { "@babel/code-frame": "^7.29.7", "@babel/generator": "^7.29.13", "@babel/helper-globals": "^7.29.7", "@babel/parser": "^7.29.13", "@babel/template": "^7.29.7", "@babel/types": "^7.29.11", "debug": "^4.3.1" } }, "sha512-0ve0xMlFA73dgY1oyJRY6RoW+/bncdcOQqg6jjYcVfXBK90OdLXjm9R6lmRetdZVrPjXkKIoMVBqYFPjcAlZ4Q=="], + + "@babel/helper-skip-transparent-expression-wrappers/@babel/types": ["@babel/types@7.29.11", "", { "dependencies": { "@babel/helper-string-parser": "^7.29.11", "@babel/helper-validator-identifier": "^7.29.7" } }, "sha512-WCsemW40Cpc6gouC1SrY6PBaZ+oLRlEVY9XBvZBI7il/HyUrb2nJ505wE1MHEFyDZNnrWDEuy4jL50WVHfTTSQ=="], + + "@cspotcode/source-map-support/@jridgewell/trace-mapping": ["@jridgewell/trace-mapping@0.3.9", "", { "dependencies": { "@jridgewell/resolve-uri": "^3.0.3", "@jridgewell/sourcemap-codec": "^1.4.10" } }, "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ=="], "@img/sharp-freebsd-wasm32/@img/sharp-wasm32": ["@img/sharp-wasm32@0.35.4", "", { "dependencies": { "@emnapi/runtime": "^1.11.3" } }, "sha512-zQnl4Kwp7Q6NHsENtU2T/00Zi+w3AQNwz3+UaTyVBy2FpXrzXzGjndpK61onhZjRtRpQXxCTeqw19bVyXOh7jA=="], @@ -1456,10 +1495,6 @@ "@img/sharp-webcontainers-wasm32/@img/sharp-wasm32": ["@img/sharp-wasm32@0.35.4", "", { "dependencies": { "@emnapi/runtime": "^1.11.3" } }, "sha512-zQnl4Kwp7Q6NHsENtU2T/00Zi+w3AQNwz3+UaTyVBy2FpXrzXzGjndpK61onhZjRtRpQXxCTeqw19bVyXOh7jA=="], - "@jridgewell/gen-mapping/@jridgewell/trace-mapping": ["@jridgewell/trace-mapping@0.3.31", "", { "dependencies": { "@jridgewell/resolve-uri": "^3.1.0", "@jridgewell/sourcemap-codec": "^1.4.14" } }, "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw=="], - - "@jridgewell/remapping/@jridgewell/trace-mapping": ["@jridgewell/trace-mapping@0.3.31", "", { "dependencies": { "@jridgewell/resolve-uri": "^3.1.0", "@jridgewell/sourcemap-codec": "^1.4.14" } }, "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw=="], - "@moq/auth/typescript": ["typescript@7.0.2", "", { "optionalDependencies": { "@typescript/typescript-aix-ppc64": "7.0.2", "@typescript/typescript-darwin-arm64": "7.0.2", "@typescript/typescript-darwin-x64": "7.0.2", "@typescript/typescript-freebsd-arm64": "7.0.2", "@typescript/typescript-freebsd-x64": "7.0.2", "@typescript/typescript-linux-arm": "7.0.2", "@typescript/typescript-linux-arm64": "7.0.2", "@typescript/typescript-linux-loong64": "7.0.2", "@typescript/typescript-linux-mips64el": "7.0.2", "@typescript/typescript-linux-ppc64": "7.0.2", "@typescript/typescript-linux-riscv64": "7.0.2", "@typescript/typescript-linux-s390x": "7.0.2", "@typescript/typescript-linux-x64": "7.0.2", "@typescript/typescript-netbsd-arm64": "7.0.2", "@typescript/typescript-netbsd-x64": "7.0.2", "@typescript/typescript-openbsd-arm64": "7.0.2", "@typescript/typescript-openbsd-x64": "7.0.2", "@typescript/typescript-sunos-x64": "7.0.2", "@typescript/typescript-win32-arm64": "7.0.2", "@typescript/typescript-win32-x64": "7.0.2" }, "bin": { "tsc": "bin/tsc" } }, "sha512-8FYau96o3NKOhbjKi/qNvG/W5jhzxkbdm5sj9AbZ/5T5sWqn3hJgLfGx27sRKZWTvyzCP8dLRBTf5tBTSRVUNA=="], "@moq/clock/typescript": ["typescript@7.0.2", "", { "optionalDependencies": { "@typescript/typescript-aix-ppc64": "7.0.2", "@typescript/typescript-darwin-arm64": "7.0.2", "@typescript/typescript-darwin-x64": "7.0.2", "@typescript/typescript-freebsd-arm64": "7.0.2", "@typescript/typescript-freebsd-x64": "7.0.2", "@typescript/typescript-linux-arm": "7.0.2", "@typescript/typescript-linux-arm64": "7.0.2", "@typescript/typescript-linux-loong64": "7.0.2", "@typescript/typescript-linux-mips64el": "7.0.2", "@typescript/typescript-linux-ppc64": "7.0.2", "@typescript/typescript-linux-riscv64": "7.0.2", "@typescript/typescript-linux-s390x": "7.0.2", "@typescript/typescript-linux-x64": "7.0.2", "@typescript/typescript-netbsd-arm64": "7.0.2", "@typescript/typescript-netbsd-x64": "7.0.2", "@typescript/typescript-openbsd-arm64": "7.0.2", "@typescript/typescript-openbsd-x64": "7.0.2", "@typescript/typescript-sunos-x64": "7.0.2", "@typescript/typescript-win32-arm64": "7.0.2", "@typescript/typescript-win32-x64": "7.0.2" }, "bin": { "tsc": "bin/tsc" } }, "sha512-8FYau96o3NKOhbjKi/qNvG/W5jhzxkbdm5sj9AbZ/5T5sWqn3hJgLfGx27sRKZWTvyzCP8dLRBTf5tBTSRVUNA=="], @@ -1596,6 +1631,32 @@ "wrangler/esbuild": ["esbuild@0.28.1", "", { "optionalDependencies": { "@esbuild/aix-ppc64": "0.28.1", "@esbuild/android-arm": "0.28.1", "@esbuild/android-arm64": "0.28.1", "@esbuild/android-x64": "0.28.1", "@esbuild/darwin-arm64": "0.28.1", "@esbuild/darwin-x64": "0.28.1", "@esbuild/freebsd-arm64": "0.28.1", "@esbuild/freebsd-x64": "0.28.1", "@esbuild/linux-arm": "0.28.1", "@esbuild/linux-arm64": "0.28.1", "@esbuild/linux-ia32": "0.28.1", "@esbuild/linux-loong64": "0.28.1", "@esbuild/linux-mips64el": "0.28.1", "@esbuild/linux-ppc64": "0.28.1", "@esbuild/linux-riscv64": "0.28.1", "@esbuild/linux-s390x": "0.28.1", "@esbuild/linux-x64": "0.28.1", "@esbuild/netbsd-arm64": "0.28.1", "@esbuild/netbsd-x64": "0.28.1", "@esbuild/openbsd-arm64": "0.28.1", "@esbuild/openbsd-x64": "0.28.1", "@esbuild/openharmony-arm64": "0.28.1", "@esbuild/sunos-x64": "0.28.1", "@esbuild/win32-arm64": "0.28.1", "@esbuild/win32-ia32": "0.28.1", "@esbuild/win32-x64": "0.28.1" }, "bin": { "esbuild": "bin/esbuild" } }, "sha512-HrJrvZv5ayxBzPfwphOoNzkzOIIlifzk0KJrGK2c8R4+LKpMtpYLQeUdjnwjWv/LZlkH2laZk+4w78pi99D4Vw=="], + "@babel/helper-create-class-features-plugin/@babel/traverse/@babel/generator": ["@babel/generator@7.29.13", "", { "dependencies": { "@babel/parser": "^7.29.13", "@babel/types": "^7.29.11", "@jridgewell/gen-mapping": "^0.3.12", "@jridgewell/trace-mapping": "^0.3.28", "jsesc": "^3.0.2" } }, "sha512-T5FRo+RzVHvGjWOuF1Ljc44b+NXAOazodHkGUHp4I3zCkQ4/sNVJm56h1S278LMR0bY5xBhztGziSbli8zObIw=="], + + "@babel/helper-create-class-features-plugin/@babel/traverse/@babel/parser": ["@babel/parser@7.29.13", "", { "dependencies": { "@babel/types": "^7.29.11" }, "bin": "./bin/babel-parser.js" }, "sha512-fJM50YYjlTiBhgdkGmC1tBpv+FMAyo4annf2X6Aks+0yRlaiVkYW/3f07xAfVVkYIoZ9fFZp+mEThUFnuybhkQ=="], + + "@babel/helper-create-class-features-plugin/@babel/traverse/@babel/types": ["@babel/types@7.29.11", "", { "dependencies": { "@babel/helper-string-parser": "^7.29.11", "@babel/helper-validator-identifier": "^7.29.7" } }, "sha512-WCsemW40Cpc6gouC1SrY6PBaZ+oLRlEVY9XBvZBI7il/HyUrb2nJ505wE1MHEFyDZNnrWDEuy4jL50WVHfTTSQ=="], + + "@babel/helper-member-expression-to-functions/@babel/traverse/@babel/generator": ["@babel/generator@7.29.13", "", { "dependencies": { "@babel/parser": "^7.29.13", "@babel/types": "^7.29.11", "@jridgewell/gen-mapping": "^0.3.12", "@jridgewell/trace-mapping": "^0.3.28", "jsesc": "^3.0.2" } }, "sha512-T5FRo+RzVHvGjWOuF1Ljc44b+NXAOazodHkGUHp4I3zCkQ4/sNVJm56h1S278LMR0bY5xBhztGziSbli8zObIw=="], + + "@babel/helper-member-expression-to-functions/@babel/traverse/@babel/parser": ["@babel/parser@7.29.13", "", { "dependencies": { "@babel/types": "^7.29.11" }, "bin": "./bin/babel-parser.js" }, "sha512-fJM50YYjlTiBhgdkGmC1tBpv+FMAyo4annf2X6Aks+0yRlaiVkYW/3f07xAfVVkYIoZ9fFZp+mEThUFnuybhkQ=="], + + "@babel/helper-member-expression-to-functions/@babel/types/@babel/helper-string-parser": ["@babel/helper-string-parser@7.29.13", "", {}, "sha512-fWegr+WsEsiMVW4KUNdIIzzMTZSzNiqhy0//6+2MRi2d5NFNsL/AYwBQW8eBnRbTBVRnDVzjaJEUqKaCWjMMdQ=="], + + "@babel/helper-optimise-call-expression/@babel/types/@babel/helper-string-parser": ["@babel/helper-string-parser@7.29.13", "", {}, "sha512-fWegr+WsEsiMVW4KUNdIIzzMTZSzNiqhy0//6+2MRi2d5NFNsL/AYwBQW8eBnRbTBVRnDVzjaJEUqKaCWjMMdQ=="], + + "@babel/helper-replace-supers/@babel/traverse/@babel/generator": ["@babel/generator@7.29.13", "", { "dependencies": { "@babel/parser": "^7.29.13", "@babel/types": "^7.29.11", "@jridgewell/gen-mapping": "^0.3.12", "@jridgewell/trace-mapping": "^0.3.28", "jsesc": "^3.0.2" } }, "sha512-T5FRo+RzVHvGjWOuF1Ljc44b+NXAOazodHkGUHp4I3zCkQ4/sNVJm56h1S278LMR0bY5xBhztGziSbli8zObIw=="], + + "@babel/helper-replace-supers/@babel/traverse/@babel/parser": ["@babel/parser@7.29.13", "", { "dependencies": { "@babel/types": "^7.29.11" }, "bin": "./bin/babel-parser.js" }, "sha512-fJM50YYjlTiBhgdkGmC1tBpv+FMAyo4annf2X6Aks+0yRlaiVkYW/3f07xAfVVkYIoZ9fFZp+mEThUFnuybhkQ=="], + + "@babel/helper-replace-supers/@babel/traverse/@babel/types": ["@babel/types@7.29.11", "", { "dependencies": { "@babel/helper-string-parser": "^7.29.11", "@babel/helper-validator-identifier": "^7.29.7" } }, "sha512-WCsemW40Cpc6gouC1SrY6PBaZ+oLRlEVY9XBvZBI7il/HyUrb2nJ505wE1MHEFyDZNnrWDEuy4jL50WVHfTTSQ=="], + + "@babel/helper-skip-transparent-expression-wrappers/@babel/traverse/@babel/generator": ["@babel/generator@7.29.13", "", { "dependencies": { "@babel/parser": "^7.29.13", "@babel/types": "^7.29.11", "@jridgewell/gen-mapping": "^0.3.12", "@jridgewell/trace-mapping": "^0.3.28", "jsesc": "^3.0.2" } }, "sha512-T5FRo+RzVHvGjWOuF1Ljc44b+NXAOazodHkGUHp4I3zCkQ4/sNVJm56h1S278LMR0bY5xBhztGziSbli8zObIw=="], + + "@babel/helper-skip-transparent-expression-wrappers/@babel/traverse/@babel/parser": ["@babel/parser@7.29.13", "", { "dependencies": { "@babel/types": "^7.29.11" }, "bin": "./bin/babel-parser.js" }, "sha512-fJM50YYjlTiBhgdkGmC1tBpv+FMAyo4annf2X6Aks+0yRlaiVkYW/3f07xAfVVkYIoZ9fFZp+mEThUFnuybhkQ=="], + + "@babel/helper-skip-transparent-expression-wrappers/@babel/types/@babel/helper-string-parser": ["@babel/helper-string-parser@7.29.13", "", {}, "sha512-fWegr+WsEsiMVW4KUNdIIzzMTZSzNiqhy0//6+2MRi2d5NFNsL/AYwBQW8eBnRbTBVRnDVzjaJEUqKaCWjMMdQ=="], + "@img/sharp-freebsd-wasm32/@img/sharp-wasm32/@emnapi/runtime": ["@emnapi/runtime@1.11.3", "", { "dependencies": { "tslib": "^2.4.0" } }, "sha512-Xz4Tpyki7XyrpbUK1jR1AhdAdaXyhhY4lZ3neLodmhpuWfy2PAQN5B46sAiU4liOXGLkHypn/qU+jvfWSCYYLA=="], "@img/sharp-webcontainers-wasm32/@img/sharp-wasm32/@emnapi/runtime": ["@emnapi/runtime@1.11.3", "", { "dependencies": { "tslib": "^2.4.0" } }, "sha512-Xz4Tpyki7XyrpbUK1jR1AhdAdaXyhhY4lZ3neLodmhpuWfy2PAQN5B46sAiU4liOXGLkHypn/qU+jvfWSCYYLA=="], @@ -1768,6 +1829,10 @@ "wrangler/esbuild/@esbuild/win32-x64": ["@esbuild/win32-x64@0.28.1", "", { "os": "win32", "cpu": "x64" }, "sha512-bm4Mowrv+GXMlpWX++EcXw/iLyd1o3+bJkC2DkWXYVvgZCqD/bSj9ctZeAMC3cIxgjRVR2Dufaiu4YPxr5gW1A=="], + "@babel/helper-create-class-features-plugin/@babel/traverse/@babel/types/@babel/helper-string-parser": ["@babel/helper-string-parser@7.29.13", "", {}, "sha512-fWegr+WsEsiMVW4KUNdIIzzMTZSzNiqhy0//6+2MRi2d5NFNsL/AYwBQW8eBnRbTBVRnDVzjaJEUqKaCWjMMdQ=="], + + "@babel/helper-replace-supers/@babel/traverse/@babel/types/@babel/helper-string-parser": ["@babel/helper-string-parser@7.29.13", "", {}, "sha512-fWegr+WsEsiMVW4KUNdIIzzMTZSzNiqhy0//6+2MRi2d5NFNsL/AYwBQW8eBnRbTBVRnDVzjaJEUqKaCWjMMdQ=="], + "kokoro-js/@huggingface/transformers/onnxruntime-node/onnxruntime-common": ["onnxruntime-common@1.21.0", "", {}, "sha512-Q632iLLrtCAVOTO65dh2+mNbQir/QNTVBG3h/QdZBpns7mZ0RYbLRBgGABPbpU9351AgYy7SJf1WaeVwMrBFPQ=="], "kokoro-js/@huggingface/transformers/onnxruntime-web/onnxruntime-common": ["onnxruntime-common@1.22.0-dev.20250409-89f8206ba4", "", {}, "sha512-vDJMkfCfb0b1A836rgHj+ORuZf4B4+cc2bASQtpeoJLueuFc5DuYwjIZUBrSvx/fO5IrLjLz+oTrB3pcGlhovQ=="], diff --git a/quest/m0/README.md b/quest/m0/README.md index 3799fdc9..11063be4 100644 --- a/quest/m0/README.md +++ b/quest/m0/README.md @@ -13,5 +13,4 @@ verified presence and volume bugs. Each child is independently shippable. ## Required - [Recover media toggles](/quest/m0/media-toggles.md) - audio and video resume without reloading -- [Correct favorite presence](/quest/m0/favorite-presence.md) - each room and the app badge show current participants - [Preserve speaker gain](/quest/m0/speaker-volume.md) - supported volume survives reload and mute cycles diff --git a/quest/m0/favorite-presence.md b/quest/m0/favorite-presence.md deleted file mode 100644 index 434d85c8..00000000 --- a/quest/m0/favorite-presence.md +++ /dev/null @@ -1,23 +0,0 @@ -# [S] Scope favorite-room presence and balance the app badge - -## Goal - -Each favorite shows only its own participants, and the application badge equals -the current total after joins, leaves, count changes, and removal of a favorite. - -## Plan - -Confirmed in `app/src/home.tsx`: `FavoriteRoom` passes no `path` to -`PreviewRoomCompact`, although `app/src/preview.tsx` accepts it. Multiple favorite -cards therefore watch the same unfiltered announcement set. -Pass each room's prefix using the existing preview API and verify boundary-safe -matching against sibling room names. - -The same component returns a cleanup callback from Solid's `createEffect`. -Solid does not register that as teardown: use `onCleanup` inside the effect so -each prior count is decremented before a new one is added and on disposal. -Verify with two favorite rooms, a changing count, and unmount/removal; mock the -announcement input rather than requiring a live relay for every unit test. - -Keep these fixes together because they establish one correct presence total. -The maintainer's AFK request authorizes the recommended m0 priority. From a58a176a53fa19c6630b6f4bda5c81ce285f1600 Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Sat, 7 Nov 2026 10:10:07 -0800 Subject: [PATCH 3/4] fix: apply badge deltas and recover platform writes --- app/src/components/badge.test.ts | 26 ++++++++++++++++++++++++++ app/src/components/badge.ts | 8 ++++---- app/src/home.test.ts | 28 ++++++++++++++++++---------- app/src/home.tsx | 11 +++++++---- 4 files changed, 55 insertions(+), 18 deletions(-) diff --git a/app/src/components/badge.test.ts b/app/src/components/badge.test.ts index 9a16348c..e8316da3 100644 --- a/app/src/components/badge.test.ts +++ b/app/src/components/badge.test.ts @@ -56,3 +56,29 @@ test("closing a badge clears it after its pending update and before a new owner' await flush(); expect(calls).toEqual([2, "clear", 1, "clear"]); }); + +test("a synchronous platform failure does not stop later badge updates or clears", async () => { + const calls: (number | "clear")[] = []; + Object.defineProperty(navigator, "setAppBadge", { + configurable: true, + value: (count: number) => { + if (count === 2) throw new Error("platform unavailable"); + calls.push(count); + return Promise.resolve(); + }, + }); + Object.defineProperty(navigator, "clearAppBadge", { + configurable: true, + value: async () => { + calls.push("clear"); + }, + }); + badge = new Badge(); + badge.set(2); + badge.set(3); + badge.close(); + badge = new Badge(); + badge.set(1); + await flush(); + expect(calls).toEqual([3, "clear", 1]); +}); diff --git a/app/src/components/badge.ts b/app/src/components/badge.ts index c087fb78..1a09b0ef 100644 --- a/app/src/components/badge.ts +++ b/app/src/components/badge.ts @@ -6,16 +6,16 @@ let pending = Promise.resolve(); async function set(count: number): Promise { if (Tauri.Api) { - const success = await Tauri.Api.window - .getCurrentWindow() - .setBadgeCount(count || undefined) + const success = await Promise.resolve() + .then(() => Tauri.Api?.window.getCurrentWindow().setBadgeCount(count || undefined)) .then(() => true) .catch(() => false); if (success) return; } if (count ? navigator.setAppBadge : navigator.clearAppBadge) { - const success = await (count ? navigator.setAppBadge(count) : navigator.clearAppBadge()) + const success = await Promise.resolve() + .then(() => (count ? navigator.setAppBadge(count) : navigator.clearAppBadge())) .then(() => true) .catch(() => false); if (success) return; diff --git a/app/src/home.test.ts b/app/src/home.test.ts index 531f33bf..e8e3952f 100644 --- a/app/src/home.test.ts +++ b/app/src/home.test.ts @@ -7,22 +7,20 @@ import { render } from "solid-js/web"; // Exercise the real Home, favorite cards, and preview rosters without API or relay I/O. const origin = new Moq.Origin.Producer(); -const connection = new Moq.Connection({ enabled: false }); -Object.defineProperty(connection, "origin", { value: new Signal(origin) }); const authenticated = new Signal(true); let favorites = [ { room: "room", created_at: 0 }, { room: "roommate", created_at: 0 }, ]; -const badgeCounts: (number | undefined)[] = []; +const badgeCounts: (number | "clear" | "flag")[] = []; Object.defineProperty(navigator, "setAppBadge", { configurable: true, value: async (count?: number) => { - badgeCounts.push(count); + badgeCounts.push(count ?? "flag"); }, }); const clearBadge = mock(async () => { - badgeCounts.push(undefined); + badgeCounts.push("clear"); }); Object.defineProperty(navigator, "clearAppBadge", { configurable: true, @@ -72,9 +70,10 @@ const originalConnection = Moq.Connection; mock.module("@moq/net", () => ({ ...Moq, Connection: class extends originalConnection { + override readonly origin = new Signal(origin); + constructor() { super({ enabled: false }); - Object.defineProperty(this, "origin", { value: connection.origin }); } }, })); @@ -103,7 +102,6 @@ afterEach(async () => { for (const catalog of catalogs) catalog.finish(); for (const route of routes) route.close(); origin.close(); - connection.close(); await flush(); document.body.replaceChildren(); }); @@ -125,8 +123,18 @@ test("favorites scope sibling rooms and balance the badge through joins, leaves, expect(counts()).toEqual(["1", "1"]); expect(badgeCounts.at(-1)).toBe(2); + badgeCounts.length = 0; + const secondRoomRoute = announce("room/carol/camera.hang"); + await flush(); + expect(counts()).toEqual(["2", "1"]); + expect(badgeCounts).toEqual([3]); + roomRoute.close(); await flush(); + expect(counts()).toEqual(["1", "1"]); + expect(badgeCounts.at(-1)).toBe(2); + secondRoomRoute.close(); + await flush(); expect(counts()).toEqual(["0", "1"]); expect(badgeCounts.at(-1)).toBe(1); @@ -135,14 +143,14 @@ test("favorites scope sibling rooms and balance the badge through joins, leaves, remove.click(); await flush(); expect(cards()).toHaveLength(1); - expect(badgeCounts.at(-1)).toBeUndefined(); + expect(badgeCounts.at(-1)).toBe("clear"); expect(clearBadge).toHaveBeenCalled(); - announce("room/carol/camera.hang"); + announce("room/dave/camera.hang"); await flush(); expect(badgeCounts.at(-1)).toBe(1); dispose(); dispose = undefined; await flush(); - expect(badgeCounts.at(-1)).toBeUndefined(); + expect(badgeCounts.at(-1)).toBe("clear"); }); diff --git a/app/src/home.tsx b/app/src/home.tsx index 9cad47b1..7056e8bc 100644 --- a/app/src/home.tsx +++ b/app/src/home.tsx @@ -167,13 +167,16 @@ function FavoriteRoom(props: { }): JSX.Element { const [removing, setRemoving] = createSignal(false); const [memberCount, setMemberCount] = createSignal(0); + let contribution = 0; createEffect(() => { const count = memberCount(); - props.badge.increment(count); - onCleanup(() => { - props.badge.decrement(count); - }); + if (count === contribution) return; + props.badge.increment(count - contribution); + contribution = count; + }); + onCleanup(() => { + if (contribution) props.badge.decrement(contribution); }); const handleRemove = async (e: MouseEvent) => { From f9dcfa9b8e34eb6dbaf5c785afde555e27723e84 Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Sat, 7 Nov 2026 10:49:37 -0800 Subject: [PATCH 4/4] fix: scope DOM preload to unit tests --- app/bunfig.toml | 2 -- app/package.json | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) delete mode 100644 app/bunfig.toml diff --git a/app/bunfig.toml b/app/bunfig.toml deleted file mode 100644 index 8755352e..00000000 --- a/app/bunfig.toml +++ /dev/null @@ -1,2 +0,0 @@ -[test] -preload = ["./test/setup.ts"] diff --git a/app/package.json b/app/package.json index 0c872227..2d451060 100644 --- a/app/package.json +++ b/app/package.json @@ -11,7 +11,7 @@ "deps": "bun run --cwd ../api build && bun run --cwd ../moq/js/libav build", "fix": "biome check --fix", "tauri": "tauri", - "test": "bun test --isolate --conditions=browser src" + "test": "bun test --isolate --conditions=browser --preload ./test/setup.ts src" }, "license": "MIT", "dependencies": {