Compare commits

..
Author SHA1 Message Date
Johannes Marbach d423d9bdcc Explain when we can drop --no-experimental-webstorage 2026-11-30 14:56:09 +01:00
Johannes Marbach fe06f6ba27 Switch to node26 2026-11-30 13:39:43 +01:00
Johannes Marbach 303ec1b399 Merge pull request #4522 from element-hq/renovate/livekit-components
Update dependency @livekit/components-core to v0.12.17
2026-11-30 08:10:22 +01:00
renovate[bot] ff3a1817a7 Update ghcr.io/element-hq/element-web:develop Docker digest to 9ed1f21 (#4521)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-11-30 01:33:25 +00:00
renovate[bot] cd2b7dc392 Update dependency @livekit/components-core to v0.12.17 2026-11-30 01:26:52 +00:00
renovate[bot] 2d69dd791a Update ghcr.io/element-hq/element-web:develop Docker digest to 2c403c5 (#4519)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-11-29 02:06:26 +00:00
renovate[bot] 6dad3a43e5 Update ghcr.io/element-hq/element-web:develop Docker digest to cd777d6 (#4518)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-11-28 02:41:39 +00:00
43 changed files with 183 additions and 1211 deletions
+1 -1
View File
@@ -1 +1 @@
24
26
+2 -2
View File
@@ -19,10 +19,10 @@ services:
- ./backend/playwright_homeserver-othersite.yaml:/data/cfg/homeserver.yaml:Z
element-web:
# Pin to a SHA so that upstream cannot break our tests. Renovate handles regular updates.
image: ghcr.io/element-hq/element-web:develop@sha256:58b673f867f78fe83c08f2b688b254e34625ebfcebdc5eff84bfdf407445e88e
image: ghcr.io/element-hq/element-web:develop@sha256:9ed1f2140ce855b8e599bf4b16f9be47c3295738989574efbb0b8f0e159c5de7
element-web-1:
# Pin to a SHA so that upstream cannot break our tests. Renovate handles regular updates.
image: ghcr.io/element-hq/element-web:develop@sha256:58b673f867f78fe83c08f2b688b254e34625ebfcebdc5eff84bfdf407445e88e
image: ghcr.io/element-hq/element-web:develop@sha256:9ed1f2140ce855b8e599bf4b16f9be47c3295738989574efbb0b8f0e159c5de7
volumes:
# The other site opens the embedded package under test in place of the
# copy its image bundles (the first site opens the dev server's app.
-4
View File
@@ -172,10 +172,6 @@
"login_auth_links_prompt": "Not registered yet?",
"login_subheading": "To continue to Element",
"login_title": "Login",
"low_bandwidth_mode": {
"switch_description": "Stop all video for this call, so that audio keeps flowing on a slow network. Lasts until the call ends.",
"switch_label": "Low bandwidth mode"
},
"microphone_level": {
"label": "Microphone level",
"no_device": "No microphone found. Connect one, then try again.",
+1 -1
View File
@@ -82,7 +82,7 @@
"@types/grecaptcha": "^3.0.9",
"@types/jsdom": "^21.1.7",
"@types/lodash-es": "^4.17.12",
"@types/node": "^24.0.0",
"@types/node": "^26.6.11",
"@types/qrcode": "^1.5.5",
"@types/react": "^19.0.0",
"@types/react-dom": "^19.0.0",
-106
View File
@@ -1,106 +0,0 @@
/*
Copyright 2026 Element Creations Ltd.
SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
Please see LICENSE in the repository root for full details.
*/
import { type Browser, expect, type Page, test } from "@playwright/test";
import { SpaHelpers } from "./spa-helpers.ts";
import {
expectInboundVideo,
expectNoInboundVideo,
recordPeerConnections,
setLowBandwidthMode,
} from "./utils/low-bandwidth-mode.ts";
test.describe("Low bandwidth mode", () => {
test.skip(
({ browserName }) => browserName !== "chromium",
"Reads inbound video from Chromium's statistics, and shares a fake screen",
);
test.slow();
test("receives no video, and receives it again when turned off", async ({
browser,
}) => {
const { alice, bob } = await twoInACall(browser);
await expectInboundVideo(alice);
await setLowBandwidthMode(alice, true);
// Bob's camera looks off to Alice, and nothing of it arrives
await expect(tileOf(alice, "Bob")).toHaveAttribute(
"data-video-enabled",
"false",
);
await expectNoInboundVideo(alice);
// Bob's screen share keeps its place on Alice's stage, blank
await bob.getByRole("switch", { name: "Share screen" }).click();
await expect(alice.getByRole("radio", { name: "Spotlight" })).toBeChecked();
await expectNoInboundVideo(alice);
await setLowBandwidthMode(alice, false);
const firstFrameMs = await expectInboundVideo(alice);
test.info().annotations.push({
type: "video back after turning the mode off",
description: `${firstFrameMs} ms`,
});
await expect(tileOf(alice, "Bob")).toHaveAttribute(
"data-video-enabled",
"true",
);
});
test("stays on through a reconnection, and can be turned off during one", async ({
browser,
}) => {
const { alice } = await twoInACall(browser);
await setLowBandwidthMode(alice, true);
await expectNoInboundVideo(alice);
await alice.context().setOffline(true);
await expect(
alice.getByRole("dialog", { name: "Reconnecting…" }),
).toBeVisible({ timeout: 30000 });
await alice.context().setOffline(false);
await expect(
alice.getByRole("dialog", { name: "Reconnecting…" }),
).not.toBeVisible({ timeout: 30000 });
await expectNoInboundVideo(alice);
// The switch is reachable over the reconnecting backdrop
await alice.context().setOffline(true);
await expect(
alice.getByRole("dialog", { name: "Reconnecting…" }),
).toBeVisible({ timeout: 30000 });
await setLowBandwidthMode(alice, false);
await alice.context().setOffline(false);
await expectInboundVideo(alice);
});
});
async function twoInACall(
browser: Browser,
): Promise<{ alice: Page; bob: Page }> {
const aliceContext = await browser.newContext({ reducedMotion: "reduce" });
await recordPeerConnections(aliceContext);
const alice = await aliceContext.newPage();
await alice.goto("/");
await SpaHelpers.createCall(alice, "Alice", "Low bandwidth", true);
const inviteLink = await SpaHelpers.getCallInviteLink(alice);
const bob = await (await browser.newContext()).newPage();
await SpaHelpers.joinCallFromInviteLink(bob, inviteLink, "Bob");
await SpaHelpers.expectVideoTilesCount(alice, 2);
return { alice, bob };
}
function tileOf(page: Page, name: string): ReturnType<Page["getByTestId"]> {
return page
.getByTestId("videoTile")
.filter({ has: page.getByTestId("name_tag").filter({ hasText: name }) })
.first();
}
-107
View File
@@ -1,107 +0,0 @@
/*
Copyright 2026 Element Creations Ltd.
SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
Please see LICENSE in the repository root for full details.
*/
import {
type BrowserContext,
expect,
type FrameLocator,
type Page,
} from "@playwright/test";
declare global {
interface Window {
peerConnections?: RTCPeerConnection[];
}
}
/**
* Keeps every peer connection the pages of `context` open, so that what
* they receive can be read from the browser's own statistics. Install before
* the call loads.
*/
export async function recordPeerConnections(
context: BrowserContext,
): Promise<void> {
await context.addInitScript(() => {
const Original = window.RTCPeerConnection;
window.peerConnections = [];
window.RTCPeerConnection = class extends Original {
public constructor(config?: RTCConfiguration) {
super(config);
window.peerConnections!.push(this);
}
};
});
}
/** Bytes of video received so far, over every peer connection on the page. */
export async function inboundVideoBytes(
target: Page | FrameLocator,
): Promise<number> {
const read = async (): Promise<number> => {
let bytes = 0;
for (const connection of window.peerConnections ?? []) {
if (connection.connectionState === "closed") continue;
const report = await connection.getStats();
report.forEach((stat: RTCInboundRtpStreamStats) => {
if (stat.type === "inbound-rtp" && stat.kind === "video")
bytes += stat.bytesReceived ?? 0;
});
}
return bytes;
};
return "evaluate" in target
? target.evaluate(read)
: target.locator(":root").evaluate(read);
}
/** Expects no video to arrive for `forMs`. */
export async function expectNoInboundVideo(
target: Page | FrameLocator,
forMs = 3000,
): Promise<void> {
// What was in flight when the subscription ended may still land
await new Promise((settled) => setTimeout(settled, 1000));
const before = await inboundVideoBytes(target);
await new Promise((settled) => setTimeout(settled, forMs));
expect(await inboundVideoBytes(target)).toBe(before);
}
/** Expects video to be arriving, and returns how long it took to start. */
export async function expectInboundVideo(
target: Page | FrameLocator,
): Promise<number> {
const start = Date.now();
const before = await inboundVideoBytes(target);
await expect
.poll(async () => inboundVideoBytes(target), { timeout: 20000 })
.toBeGreaterThan(before);
return Date.now() - start;
}
/**
* Turns Low bandwidth mode on or off from the call's developer options,
* turning developer mode on first if needed.
*/
export async function setLowBandwidthMode(
target: Page | FrameLocator,
on: boolean,
): Promise<void> {
await target
.getByRole("button", { name: "Settings" })
.filter({ visible: true })
.first()
.click();
await target.getByRole("tab", { name: "Preferences" }).click();
await target.getByText("Developer mode", { exact: true }).check();
await target.getByRole("tab", { name: "Developer" }).click();
// By its label: the box itself can sit outside the dialog's scrolled view
const toggle = target.getByText("Low bandwidth mode", { exact: true });
if (on) await toggle.check();
else await toggle.uncheck();
await target.getByTestId("modal_close").click();
}
+107 -107
View File
@@ -26,7 +26,7 @@ importers:
devDependencies:
'@codecov/vite-plugin':
specifier: ^2.0.0
version: 2.0.1(vite@8.3.8(@types/node@24.19.2)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1))
version: 2.0.1(vite@8.3.8(@types/node@26.6.11)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1))
'@fontsource/inconsolata':
specifier: ^5.1.0
version: 5.3.0
@@ -41,7 +41,7 @@ importers:
version: 11.7.12
'@livekit/components-core':
specifier: ^0.12.0
version: 0.12.16(livekit-client@2.23.0(@types/dom-mediacapture-record@1.0.22))(tslib@2.9.1)
version: 0.12.17(livekit-client@2.23.0(@types/dom-mediacapture-record@1.0.22))(tslib@2.9.1)
'@livekit/track-processors':
specifier: ^0.8.0
version: 0.8.3(@types/dom-mediacapture-transform@0.1.11)(livekit-client@2.23.0(@types/dom-mediacapture-record@1.0.22))
@@ -65,7 +65,7 @@ importers:
version: 10.1.2(react-dom@19.3.1(react@19.3.1))(react@19.3.1)
'@rolldown/plugin-babel':
specifier: ^0.3.0
version: 0.3.1(@babel/core@7.29.13(supports-color@7.2.0))(@babel/runtime@8.0.8)(rolldown@1.2.19)(vite@8.3.8(@types/node@24.19.2)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1))
version: 0.3.1(@babel/core@7.29.13(supports-color@7.2.0))(@babel/runtime@8.0.8)(rolldown@1.2.19)(vite@8.3.8(@types/node@26.6.11)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1))
'@sentry/react':
specifier: ^8.0.0
version: 8.55.2(react@19.3.1)
@@ -80,7 +80,7 @@ importers:
version: 10.6.8(@vitest/browser-playwright@4.1.12)(@vitest/browser@4.1.12)(react@19.3.1)(storybook@10.6.8(@types/react@19.3.0)(prettier@3.8.3)(react@19.3.1))(vitest@4.1.12)
'@storybook/react-vite':
specifier: ^10.3.6
version: 10.6.8(@types/react-dom@19.3.0(@types/react@19.3.0))(@types/react@19.3.0)(react-dom@19.3.1(react@19.3.1))(react@19.3.1)(rollup@4.60.1)(storybook@10.6.8(@types/react@19.3.0)(prettier@3.8.3)(react@19.3.1))(supports-color@7.2.0)(typescript@5.9.3)(vite@8.3.8(@types/node@24.19.2)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1))
version: 10.6.8(@types/react-dom@19.3.0(@types/react@19.3.0))(@types/react@19.3.0)(react-dom@19.3.1(react@19.3.1))(react@19.3.1)(rollup@4.60.1)(storybook@10.6.8(@types/react@19.3.0)(prettier@3.8.3)(react@19.3.1))(supports-color@7.2.0)(typescript@5.9.3)(vite@8.3.8(@types/node@26.6.11)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1))
'@testing-library/dom':
specifier: ^10.1.0
version: 10.4.2
@@ -106,8 +106,8 @@ importers:
specifier: ^4.17.12
version: 4.17.12
'@types/node':
specifier: ^24.0.0
version: 24.19.2
specifier: ^26.6.11
version: 26.6.11
'@types/qrcode':
specifier: ^1.5.5
version: 1.5.6
@@ -134,10 +134,10 @@ importers:
version: 10.6.0(@fontsource/inconsolata@5.3.0)(@fontsource/inter@5.3.0)(@types/react-dom@19.3.0(@types/react@19.3.0))(@types/react@19.3.0)(@vector-im/compound-design-tokens@11.3.1(@types/react@19.3.0)(react@19.3.1))(react-dom@19.3.1(react@19.3.1))(react@19.3.1)
'@vitejs/plugin-react':
specifier: ^6.0.2
version: 6.3.0(@rolldown/plugin-babel@0.3.1(@babel/core@7.29.13(supports-color@7.2.0))(@babel/runtime@8.0.8)(rolldown@1.2.19)(vite@8.3.8(@types/node@24.19.2)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.8(@types/node@24.19.2)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1))
version: 6.3.0(@rolldown/plugin-babel@0.3.1(@babel/core@7.29.13(supports-color@7.2.0))(@babel/runtime@8.0.8)(rolldown@1.2.19)(vite@8.3.8(@types/node@26.6.11)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.8(@types/node@26.6.11)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1))
'@vitest/browser-playwright':
specifier: ^4.1.5
version: 4.1.12(playwright@1.65.1)(vite@8.3.8(@types/node@24.19.2)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1))(vitest@4.1.12)
version: 4.1.12(playwright@1.65.1)(vite@8.3.8(@types/node@26.6.11)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1))(vitest@4.1.12)
'@vitest/coverage-v8':
specifier: ^4.0.18
version: 4.1.12(@vitest/browser@4.1.12)(vitest@4.1.12)
@@ -173,13 +173,13 @@ importers:
version: 8.3.1
i18next-cli:
specifier: ^1.61.0
version: 1.91.3(@types/node@24.19.2)(@types/react@19.3.0)(react@19.3.1)(typescript@5.9.3)
version: 1.91.3(@types/node@26.6.11)(@types/react@19.3.0)(react@19.3.1)(typescript@5.9.3)
jsdom:
specifier: ^26.0.0
version: 26.1.0(supports-color@7.2.0)
knip:
specifier: ^5.86.0
version: 5.88.1(@emnapi/core@1.11.2)(@emnapi/runtime@1.11.2)(@types/node@24.19.2)(typescript@5.9.3)
version: 5.88.1(@emnapi/core@1.11.2)(@emnapi/runtime@1.11.2)(@types/node@26.6.11)(typescript@5.9.3)
livekit-client:
specifier: ^2.18.1
version: 2.23.0(@types/dom-mediacapture-record@1.0.22)
@@ -266,25 +266,25 @@ importers:
version: 1.1.2(@types/react-dom@19.3.0(@types/react@19.3.0))(@types/react@19.3.0)(react-dom@19.3.1(react@19.3.1))(react@19.3.1)
vite:
specifier: ^8.0.0
version: 8.3.8(@types/node@24.19.2)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1)
version: 8.3.8(@types/node@26.6.11)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1)
vite-plugin-html:
specifier: ^3.2.2
version: 3.2.2(vite@8.3.8(@types/node@24.19.2)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1))
version: 3.2.2(vite@8.3.8(@types/node@26.6.11)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1))
vite-plugin-node-polyfills:
specifier: ^0.28.0
version: 0.28.0(rollup@4.60.1)(vite@8.3.8(@types/node@24.19.2)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1))
version: 0.28.0(rollup@4.60.1)(vite@8.3.8(@types/node@26.6.11)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1))
vite-plugin-node-stdlib-browser:
specifier: ^0.2.1
version: 0.2.1(node-stdlib-browser@1.3.1)(rollup@4.60.1)(vite@8.3.8(@types/node@24.19.2)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1))
version: 0.2.1(node-stdlib-browser@1.3.1)(rollup@4.60.1)(vite@8.3.8(@types/node@26.6.11)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1))
vite-plugin-svgr:
specifier: ^4.0.0
version: 4.5.0(rollup@4.60.1)(supports-color@7.2.0)(typescript@5.9.3)(vite@8.3.8(@types/node@24.19.2)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1))
version: 4.5.0(rollup@4.60.1)(supports-color@7.2.0)(typescript@5.9.3)(vite@8.3.8(@types/node@26.6.11)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1))
vite-plugin-wasm:
specifier: ^3.6.0
version: 3.6.0(vite@8.3.8(@types/node@24.19.2)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1))
version: 3.6.0(vite@8.3.8(@types/node@26.6.11)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1))
vitest:
specifier: ^4.1.5
version: 4.1.12(@opentelemetry/api@1.9.1)(@types/node@24.19.2)(@vitest/browser-playwright@4.1.12)(@vitest/coverage-v8@4.1.12)(@vitest/ui@4.1.12)(jsdom@26.1.0(supports-color@7.2.0))(vite@8.3.8(@types/node@24.19.2)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1))
version: 4.1.12(@opentelemetry/api@1.9.1)(@types/node@26.6.11)(@vitest/browser-playwright@4.1.12)(@vitest/coverage-v8@4.1.12)(@vitest/ui@4.1.12)(jsdom@26.1.0(supports-color@7.2.0))(vite@8.3.8(@types/node@26.6.11)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1))
vitest-axe:
specifier: ^1.0.0-pre.3
version: 1.0.0-pre.5(vitest@4.1.12)
@@ -1141,8 +1141,8 @@ packages:
'@jridgewell/trace-mapping@0.3.31':
resolution: {integrity: sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==}
'@livekit/components-core@0.12.16':
resolution: {integrity: sha512-jcXuNeHKGkXgRiT4wniWRpg+TKUSoTL9da01tMxxKGmjp98zB2DVgPmk1fBZfgDVjPBF+jsZe/WkeFAbvJu4Gw==}
'@livekit/components-core@0.12.17':
resolution: {integrity: sha512-DhpVOojgl9eC+jVnnuPGGq/ijlqi5XgpZqCj/G+ijujc44UyZEprSUStjDG0ai6ymBlJics3XKLDLLtihCxssg==}
engines: {node: '>=18'}
peerDependencies:
livekit-client: ^2.20.1
@@ -3111,8 +3111,8 @@ packages:
'@types/mdx@2.0.14':
resolution: {integrity: sha512-T48PeuJtvLosNTPVhfnIp3i/n3a4g4Bad7YCq5k64D4u7NwDrAotikQ+5+sjtUvBmxCMlbo3dVL+C2dP0rWHzg==}
'@types/node@24.19.2':
resolution: {integrity: sha512-93d49wCWJkCyN87MxLpNN6KXPCwFw7bVUg79mGUV1OS40JGWwVCr8n61DXCSqz7CV6/VfPkb7xec7uP2M+QHWQ==}
'@types/node@26.6.11':
resolution: {integrity: sha512-uUyQ2XLEz+EXh34lmS3GhKrkqn/8FU7KUiKRpk347At2bmnMVWss45yz8b4FG/tUtmV1tV/+TVkITItPROyeeQ==}
'@types/qrcode@1.5.6':
resolution: {integrity: sha512-te7NQcV2BOvdj2b1hCAHzAoMNuj65kNBMz0KBaxM6c3VGBOhU0dURQKOtH8CFNI/dsKkwlv32p26qYQTWoB5bw==}
@@ -5706,8 +5706,8 @@ packages:
resolution: {integrity: sha512-X2wH19RAPZE3+ldGicOkoj/SIA83OIxcJ6Cuaw23hf8Xc6fQpvZXY0SftE2JgS0QhYLUG4uwodSI3R53keyh7w==}
engines: {node: '>=14'}
undici-types@7.24.6:
resolution: {integrity: sha512-WRNW+sJgj5OBN4/0JpHFqtqzhpbnV0GuB+OozA9gCL7a993SmU+1JBZCzLNxYsbMfIeDL+lTsphD5jN5N+n0zg==}
undici-types@8.9.0:
resolution: {integrity: sha512-KTDyRTYX8sWmKXAikPHHSyc63CRPETMctyjKFupcC6OBLXT3xsN0e9aF7m+mIXutFWpUXuedtowG7iLOzp0kQg==}
undici@6.29.1:
resolution: {integrity: sha512-EvRlUt/QqAEvXdQeRMYUfwOQsfzpDztykrG2owGEE/rBOBoYv9uF39ZzsNDh4lTFHhTr2XOZjKkYgueD12ZmGA==}
@@ -6308,11 +6308,11 @@ snapshots:
unplugin: 1.16.1
zod: 3.25.76
'@codecov/vite-plugin@2.0.1(vite@8.3.8(@types/node@24.19.2)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1))':
'@codecov/vite-plugin@2.0.1(vite@8.3.8(@types/node@26.6.11)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1))':
dependencies:
'@codecov/bundler-plugin-core': 2.0.1
unplugin: 1.16.1
vite: 8.3.8(@types/node@24.19.2)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1)
vite: 8.3.8(@types/node@26.6.11)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1)
'@croct/json5-parser@0.2.2':
dependencies:
@@ -6872,59 +6872,59 @@ snapshots:
'@inquirer/ansi@2.1.1': {}
'@inquirer/confirm@6.4.0(@types/node@24.19.2)':
'@inquirer/confirm@6.4.0(@types/node@26.6.11)':
dependencies:
'@inquirer/core': 12.1.1(@types/node@24.19.2)
'@inquirer/type': 4.3.0(@types/node@24.19.2)
'@inquirer/core': 12.1.1(@types/node@26.6.11)
'@inquirer/type': 4.3.0(@types/node@26.6.11)
optionalDependencies:
'@types/node': 24.19.2
'@types/node': 26.6.11
'@inquirer/core@12.1.1(@types/node@24.19.2)':
'@inquirer/core@12.1.1(@types/node@26.6.11)':
dependencies:
'@inquirer/ansi': 2.1.1
'@inquirer/figures': 2.1.1
'@inquirer/type': 4.3.1(@types/node@24.19.2)
'@inquirer/type': 4.3.1(@types/node@26.6.11)
cli-width: 4.1.0
fast-string-width: 3.0.2
fast-wrap-ansi: 0.2.2
mute-stream: 3.0.0
signal-exit: 4.1.0
optionalDependencies:
'@types/node': 24.19.2
'@types/node': 26.6.11
'@inquirer/figures@2.1.1': {}
'@inquirer/input@5.2.0(@types/node@24.19.2)':
'@inquirer/input@5.2.0(@types/node@26.6.11)':
dependencies:
'@inquirer/core': 12.1.1(@types/node@24.19.2)
'@inquirer/type': 4.3.0(@types/node@24.19.2)
'@inquirer/core': 12.1.1(@types/node@26.6.11)
'@inquirer/type': 4.3.0(@types/node@26.6.11)
optionalDependencies:
'@types/node': 24.19.2
'@types/node': 26.6.11
'@inquirer/password@5.3.0(@types/node@24.19.2)':
'@inquirer/password@5.3.0(@types/node@26.6.11)':
dependencies:
'@inquirer/ansi': 2.1.1
'@inquirer/core': 12.1.1(@types/node@24.19.2)
'@inquirer/type': 4.3.0(@types/node@24.19.2)
'@inquirer/core': 12.1.1(@types/node@26.6.11)
'@inquirer/type': 4.3.0(@types/node@26.6.11)
optionalDependencies:
'@types/node': 24.19.2
'@types/node': 26.6.11
'@inquirer/select@5.3.0(@types/node@24.19.2)':
'@inquirer/select@5.3.0(@types/node@26.6.11)':
dependencies:
'@inquirer/ansi': 2.1.1
'@inquirer/core': 12.1.1(@types/node@24.19.2)
'@inquirer/core': 12.1.1(@types/node@26.6.11)
'@inquirer/figures': 2.1.1
'@inquirer/type': 4.3.0(@types/node@24.19.2)
'@inquirer/type': 4.3.0(@types/node@26.6.11)
optionalDependencies:
'@types/node': 24.19.2
'@types/node': 26.6.11
'@inquirer/type@4.3.0(@types/node@24.19.2)':
'@inquirer/type@4.3.0(@types/node@26.6.11)':
optionalDependencies:
'@types/node': 24.19.2
'@types/node': 26.6.11
'@inquirer/type@4.3.1(@types/node@24.19.2)':
'@inquirer/type@4.3.1(@types/node@26.6.11)':
optionalDependencies:
'@types/node': 24.19.2
'@types/node': 26.6.11
'@isaacs/cliui@8.0.2':
dependencies:
@@ -6937,11 +6937,11 @@ snapshots:
'@isaacs/nonrecursive-glob-match@1.1.0': {}
'@joshwooding/vite-plugin-react-docgen-typescript@0.7.0(typescript@5.9.3)(vite@8.3.8(@types/node@24.19.2)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1))':
'@joshwooding/vite-plugin-react-docgen-typescript@0.7.0(typescript@5.9.3)(vite@8.3.8(@types/node@26.6.11)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1))':
dependencies:
glob: 10.5.0
react-docgen-typescript: 2.4.0(typescript@5.9.3)
vite: 8.3.8(@types/node@24.19.2)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1)
vite: 8.3.8(@types/node@26.6.11)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1)
optionalDependencies:
typescript: 5.9.3
@@ -6969,7 +6969,7 @@ snapshots:
'@jridgewell/resolve-uri': 3.1.2
'@jridgewell/sourcemap-codec': 1.6.0
'@livekit/components-core@0.12.16(livekit-client@2.23.0(@types/dom-mediacapture-record@1.0.22))(tslib@2.9.1)':
'@livekit/components-core@0.12.17(livekit-client@2.23.0(@types/dom-mediacapture-record@1.0.22))(tslib@2.9.1)':
dependencies:
'@floating-ui/dom': 1.8.0
livekit-client: 2.23.0(@types/dom-mediacapture-record@1.0.22)
@@ -7938,7 +7938,7 @@ snapshots:
'@rolldown/binding-win32-x64-msvc@1.2.19':
optional: true
'@rolldown/plugin-babel@0.3.1(@babel/core@7.29.13(supports-color@7.2.0))(@babel/runtime@8.0.8)(rolldown@1.2.19)(vite@8.3.8(@types/node@24.19.2)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1))':
'@rolldown/plugin-babel@0.3.1(@babel/core@7.29.13(supports-color@7.2.0))(@babel/runtime@8.0.8)(rolldown@1.2.19)(vite@8.3.8(@types/node@26.6.11)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1))':
dependencies:
'@babel/core': 7.29.13(supports-color@7.2.0)
artichokie: 0.4.5
@@ -7946,7 +7946,7 @@ snapshots:
rolldown: 1.2.19
optionalDependencies:
'@babel/runtime': 8.0.8
vite: 8.3.8(@types/node@24.19.2)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1)
vite: 8.3.8(@types/node@26.6.11)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1)
'@rolldown/pluginutils@1.1.1': {}
@@ -8180,17 +8180,17 @@ snapshots:
'@storybook/icons': 2.2.0(react@19.3.1)
storybook: 10.6.8(@types/react@19.3.0)(prettier@3.8.3)(react@19.3.1)
optionalDependencies:
'@vitest/browser': 4.1.12(vite@8.3.8(@types/node@24.19.2)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1))(vitest@4.1.12)
'@vitest/browser-playwright': 4.1.12(playwright@1.65.1)(vite@8.3.8(@types/node@24.19.2)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1))(vitest@4.1.12)
vitest: 4.1.12(@opentelemetry/api@1.9.1)(@types/node@24.19.2)(@vitest/browser-playwright@4.1.12)(@vitest/coverage-v8@4.1.12)(@vitest/ui@4.1.12)(jsdom@26.1.0(supports-color@7.2.0))(vite@8.3.8(@types/node@24.19.2)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1))
'@vitest/browser': 4.1.12(vite@8.3.8(@types/node@26.6.11)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1))(vitest@4.1.12)
'@vitest/browser-playwright': 4.1.12(playwright@1.65.1)(vite@8.3.8(@types/node@26.6.11)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1))(vitest@4.1.12)
vitest: 4.1.12(@opentelemetry/api@1.9.1)(@types/node@26.6.11)(@vitest/browser-playwright@4.1.12)(@vitest/coverage-v8@4.1.12)(@vitest/ui@4.1.12)(jsdom@26.1.0(supports-color@7.2.0))(vite@8.3.8(@types/node@26.6.11)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1))
transitivePeerDependencies:
- react
'@storybook/builder-vite@10.6.8(storybook@10.6.8(@types/react@19.3.0)(prettier@3.8.3)(react@19.3.1))(vite@8.3.8(@types/node@24.19.2)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1))':
'@storybook/builder-vite@10.6.8(storybook@10.6.8(@types/react@19.3.0)(prettier@3.8.3)(react@19.3.1))(vite@8.3.8(@types/node@26.6.11)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1))':
dependencies:
storybook: 10.6.8(@types/react@19.3.0)(prettier@3.8.3)(react@19.3.1)
ts-dedent: 2.3.0
vite: 8.3.8(@types/node@24.19.2)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1)
vite: 8.3.8(@types/node@26.6.11)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1)
'@storybook/global@5.0.0': {}
@@ -8207,11 +8207,11 @@ snapshots:
'@types/react': 19.3.0
'@types/react-dom': 19.3.0(@types/react@19.3.0)
'@storybook/react-vite@10.6.8(@types/react-dom@19.3.0(@types/react@19.3.0))(@types/react@19.3.0)(react-dom@19.3.1(react@19.3.1))(react@19.3.1)(rollup@4.60.1)(storybook@10.6.8(@types/react@19.3.0)(prettier@3.8.3)(react@19.3.1))(supports-color@7.2.0)(typescript@5.9.3)(vite@8.3.8(@types/node@24.19.2)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1))':
'@storybook/react-vite@10.6.8(@types/react-dom@19.3.0(@types/react@19.3.0))(@types/react@19.3.0)(react-dom@19.3.1(react@19.3.1))(react@19.3.1)(rollup@4.60.1)(storybook@10.6.8(@types/react@19.3.0)(prettier@3.8.3)(react@19.3.1))(supports-color@7.2.0)(typescript@5.9.3)(vite@8.3.8(@types/node@26.6.11)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1))':
dependencies:
'@joshwooding/vite-plugin-react-docgen-typescript': 0.7.0(typescript@5.9.3)(vite@8.3.8(@types/node@24.19.2)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1))
'@joshwooding/vite-plugin-react-docgen-typescript': 0.7.0(typescript@5.9.3)(vite@8.3.8(@types/node@26.6.11)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1))
'@rollup/pluginutils': 5.5.1(rollup@4.60.1)
'@storybook/builder-vite': 10.6.8(storybook@10.6.8(@types/react@19.3.0)(prettier@3.8.3)(react@19.3.1))(vite@8.3.8(@types/node@24.19.2)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1))
'@storybook/builder-vite': 10.6.8(storybook@10.6.8(@types/react@19.3.0)(prettier@3.8.3)(react@19.3.1))(vite@8.3.8(@types/node@26.6.11)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1))
'@storybook/react': 10.6.8(@types/react-dom@19.3.0(@types/react@19.3.0))(@types/react@19.3.0)(react-dom@19.3.1(react@19.3.1))(react@19.3.1)(storybook@10.6.8(@types/react@19.3.0)(prettier@3.8.3)(react@19.3.1))(supports-color@7.2.0)(typescript@5.9.3)
empathic: 2.1.0
magic-string: 1.4.5
@@ -8221,7 +8221,7 @@ snapshots:
resolve: 1.22.14
storybook: 10.6.8(@types/react@19.3.0)(prettier@3.8.3)(react@19.3.1)
tsconfig-paths: 4.2.0
vite: 8.3.8(@types/node@24.19.2)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1)
vite: 8.3.8(@types/node@26.6.11)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1)
optionalDependencies:
typescript: 5.9.3
transitivePeerDependencies:
@@ -8479,7 +8479,7 @@ snapshots:
'@types/jsdom@21.1.7':
dependencies:
'@types/node': 24.19.2
'@types/node': 26.6.11
'@types/tough-cookie': 4.0.5
parse5: 7.3.0
@@ -8493,13 +8493,13 @@ snapshots:
'@types/mdx@2.0.14': {}
'@types/node@24.19.2':
'@types/node@26.6.11':
dependencies:
undici-types: 7.24.6
undici-types: 8.9.0
'@types/qrcode@1.5.6':
dependencies:
'@types/node': 24.19.2
'@types/node': 26.6.11
'@types/react-dom@19.3.0(@types/react@19.3.0)':
dependencies:
@@ -8658,37 +8658,37 @@ snapshots:
- '@types/react-dom'
- react-dom
'@vitejs/plugin-react@6.3.0(@rolldown/plugin-babel@0.3.1(@babel/core@7.29.13(supports-color@7.2.0))(@babel/runtime@8.0.8)(rolldown@1.2.19)(vite@8.3.8(@types/node@24.19.2)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.8(@types/node@24.19.2)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1))':
'@vitejs/plugin-react@6.3.0(@rolldown/plugin-babel@0.3.1(@babel/core@7.29.13(supports-color@7.2.0))(@babel/runtime@8.0.8)(rolldown@1.2.19)(vite@8.3.8(@types/node@26.6.11)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.8(@types/node@26.6.11)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1))':
dependencies:
'@rolldown/pluginutils': 1.1.1
vite: 8.3.8(@types/node@24.19.2)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1)
vite: 8.3.8(@types/node@26.6.11)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1)
optionalDependencies:
'@rolldown/plugin-babel': 0.3.1(@babel/core@7.29.13(supports-color@7.2.0))(@babel/runtime@8.0.8)(rolldown@1.2.19)(vite@8.3.8(@types/node@24.19.2)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1))
'@rolldown/plugin-babel': 0.3.1(@babel/core@7.29.13(supports-color@7.2.0))(@babel/runtime@8.0.8)(rolldown@1.2.19)(vite@8.3.8(@types/node@26.6.11)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1))
babel-plugin-react-compiler: 1.0.0
'@vitest/browser-playwright@4.1.12(playwright@1.65.1)(vite@8.3.8(@types/node@24.19.2)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1))(vitest@4.1.12)':
'@vitest/browser-playwright@4.1.12(playwright@1.65.1)(vite@8.3.8(@types/node@26.6.11)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1))(vitest@4.1.12)':
dependencies:
'@vitest/browser': 4.1.12(vite@8.3.8(@types/node@24.19.2)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1))(vitest@4.1.12)
'@vitest/mocker': 4.1.12(vite@8.3.8(@types/node@24.19.2)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1))
'@vitest/browser': 4.1.12(vite@8.3.8(@types/node@26.6.11)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1))(vitest@4.1.12)
'@vitest/mocker': 4.1.12(vite@8.3.8(@types/node@26.6.11)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1))
playwright: 1.65.1
tinyrainbow: 3.2.0
vitest: 4.1.12(@opentelemetry/api@1.9.1)(@types/node@24.19.2)(@vitest/browser-playwright@4.1.12)(@vitest/coverage-v8@4.1.12)(@vitest/ui@4.1.12)(jsdom@26.1.0(supports-color@7.2.0))(vite@8.3.8(@types/node@24.19.2)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1))
vitest: 4.1.12(@opentelemetry/api@1.9.1)(@types/node@26.6.11)(@vitest/browser-playwright@4.1.12)(@vitest/coverage-v8@4.1.12)(@vitest/ui@4.1.12)(jsdom@26.1.0(supports-color@7.2.0))(vite@8.3.8(@types/node@26.6.11)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1))
transitivePeerDependencies:
- bufferutil
- msw
- utf-8-validate
- vite
'@vitest/browser@4.1.12(vite@8.3.8(@types/node@24.19.2)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1))(vitest@4.1.12)':
'@vitest/browser@4.1.12(vite@8.3.8(@types/node@26.6.11)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1))(vitest@4.1.12)':
dependencies:
'@blazediff/core': 1.9.1
'@vitest/mocker': 4.1.12(vite@8.3.8(@types/node@24.19.2)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1))
'@vitest/mocker': 4.1.12(vite@8.3.8(@types/node@26.6.11)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1))
'@vitest/utils': 4.1.12
magic-string: 0.30.21
pngjs: 7.0.0
sirv: 3.0.2
tinyrainbow: 3.2.0
vitest: 4.1.12(@opentelemetry/api@1.9.1)(@types/node@24.19.2)(@vitest/browser-playwright@4.1.12)(@vitest/coverage-v8@4.1.12)(@vitest/ui@4.1.12)(jsdom@26.1.0(supports-color@7.2.0))(vite@8.3.8(@types/node@24.19.2)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1))
vitest: 4.1.12(@opentelemetry/api@1.9.1)(@types/node@26.6.11)(@vitest/browser-playwright@4.1.12)(@vitest/coverage-v8@4.1.12)(@vitest/ui@4.1.12)(jsdom@26.1.0(supports-color@7.2.0))(vite@8.3.8(@types/node@26.6.11)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1))
ws: 8.23.0
transitivePeerDependencies:
- bufferutil
@@ -8708,9 +8708,9 @@ snapshots:
obug: 2.2.1
std-env: 4.3.0
tinyrainbow: 3.2.0
vitest: 4.1.12(@opentelemetry/api@1.9.1)(@types/node@24.19.2)(@vitest/browser-playwright@4.1.12)(@vitest/coverage-v8@4.1.12)(@vitest/ui@4.1.12)(jsdom@26.1.0(supports-color@7.2.0))(vite@8.3.8(@types/node@24.19.2)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1))
vitest: 4.1.12(@opentelemetry/api@1.9.1)(@types/node@26.6.11)(@vitest/browser-playwright@4.1.12)(@vitest/coverage-v8@4.1.12)(@vitest/ui@4.1.12)(jsdom@26.1.0(supports-color@7.2.0))(vite@8.3.8(@types/node@26.6.11)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1))
optionalDependencies:
'@vitest/browser': 4.1.12(vite@8.3.8(@types/node@24.19.2)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1))(vitest@4.1.12)
'@vitest/browser': 4.1.12(vite@8.3.8(@types/node@26.6.11)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1))(vitest@4.1.12)
'@vitest/expect@3.2.4':
dependencies:
@@ -8729,13 +8729,13 @@ snapshots:
chai: 6.3.0
tinyrainbow: 3.2.0
'@vitest/mocker@4.1.12(vite@8.3.8(@types/node@24.19.2)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1))':
'@vitest/mocker@4.1.12(vite@8.3.8(@types/node@26.6.11)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1))':
dependencies:
'@vitest/spy': 4.1.12
estree-walker: 3.0.3
magic-string: 0.30.21
optionalDependencies:
vite: 8.3.8(@types/node@24.19.2)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1)
vite: 8.3.8(@types/node@26.6.11)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1)
'@vitest/pretty-format@3.2.4':
dependencies:
@@ -8772,7 +8772,7 @@ snapshots:
sirv: 3.0.2
tinyglobby: 0.2.17
tinyrainbow: 3.1.1
vitest: 4.1.12(@opentelemetry/api@1.9.1)(@types/node@24.19.2)(@vitest/browser-playwright@4.1.12)(@vitest/coverage-v8@4.1.12)(@vitest/ui@4.1.12)(jsdom@26.1.0(supports-color@7.2.0))(vite@8.3.8(@types/node@24.19.2)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1))
vitest: 4.1.12(@opentelemetry/api@1.9.1)(@types/node@26.6.11)(@vitest/browser-playwright@4.1.12)(@vitest/coverage-v8@4.1.12)(@vitest/ui@4.1.12)(jsdom@26.1.0(supports-color@7.2.0))(vite@8.3.8(@types/node@26.6.11)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1))
'@vitest/utils@3.2.4':
dependencies:
@@ -9747,14 +9747,14 @@ snapshots:
dependencies:
'@babel/runtime': 7.29.15
i18next-cli@1.91.3(@types/node@24.19.2)(@types/react@19.3.0)(react@19.3.1)(typescript@5.9.3):
i18next-cli@1.91.3(@types/node@26.6.11)(@types/react@19.3.0)(react@19.3.1)(typescript@5.9.3):
dependencies:
'@croct/json5-parser': 0.2.2
'@formatjs/icu-messageformat-parser': 3.5.23
'@inquirer/confirm': 6.4.0(@types/node@24.19.2)
'@inquirer/input': 5.2.0(@types/node@24.19.2)
'@inquirer/password': 5.3.0(@types/node@24.19.2)
'@inquirer/select': 5.3.0(@types/node@24.19.2)
'@inquirer/confirm': 6.4.0(@types/node@26.6.11)
'@inquirer/input': 5.2.0(@types/node@26.6.11)
'@inquirer/password': 5.3.0(@types/node@26.6.11)
'@inquirer/select': 5.3.0(@types/node@26.6.11)
'@swc/core': 1.16.22
chokidar: 5.0.0
commander: 15.1.0
@@ -9985,10 +9985,10 @@ snapshots:
dependencies:
json-buffer: 3.0.1
knip@5.88.1(@emnapi/core@1.11.2)(@emnapi/runtime@1.11.2)(@types/node@24.19.2)(typescript@5.9.3):
knip@5.88.1(@emnapi/core@1.11.2)(@emnapi/runtime@1.11.2)(@types/node@26.6.11)(typescript@5.9.3):
dependencies:
'@nodelib/fs.walk': 1.2.8
'@types/node': 24.19.2
'@types/node': 26.6.11
fast-glob: 3.3.3
formatly: 0.3.0
jiti: 2.6.1
@@ -11399,7 +11399,7 @@ snapshots:
unbash@2.2.0: {}
undici-types@7.24.6: {}
undici-types@8.9.0: {}
undici@6.29.1: {}
@@ -11489,7 +11489,7 @@ snapshots:
- '@types/react'
- '@types/react-dom'
vite-plugin-html@3.2.2(vite@8.3.8(@types/node@24.19.2)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1)):
vite-plugin-html@3.2.2(vite@8.3.8(@types/node@26.6.11)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1)):
dependencies:
'@rollup/pluginutils': 4.2.1
colorette: 2.0.20
@@ -11503,40 +11503,40 @@ snapshots:
html-minifier-terser: 6.1.0
node-html-parser: 5.4.2
pathe: 0.2.0
vite: 8.3.8(@types/node@24.19.2)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1)
vite: 8.3.8(@types/node@26.6.11)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1)
vite-plugin-node-polyfills@0.28.0(rollup@4.60.1)(vite@8.3.8(@types/node@24.19.2)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1)):
vite-plugin-node-polyfills@0.28.0(rollup@4.60.1)(vite@8.3.8(@types/node@26.6.11)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1)):
dependencies:
'@rollup/plugin-inject': 5.0.5(rollup@4.60.1)
node-stdlib-browser: 1.3.1
vite: 8.3.8(@types/node@24.19.2)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1)
vite: 8.3.8(@types/node@26.6.11)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1)
transitivePeerDependencies:
- rollup
vite-plugin-node-stdlib-browser@0.2.1(node-stdlib-browser@1.3.1)(rollup@4.60.1)(vite@8.3.8(@types/node@24.19.2)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1)):
vite-plugin-node-stdlib-browser@0.2.1(node-stdlib-browser@1.3.1)(rollup@4.60.1)(vite@8.3.8(@types/node@26.6.11)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1)):
dependencies:
'@rollup/plugin-inject': 5.0.5(rollup@4.60.1)
node-stdlib-browser: 1.3.1
vite: 8.3.8(@types/node@24.19.2)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1)
vite: 8.3.8(@types/node@26.6.11)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1)
transitivePeerDependencies:
- rollup
vite-plugin-svgr@4.5.0(rollup@4.60.1)(supports-color@7.2.0)(typescript@5.9.3)(vite@8.3.8(@types/node@24.19.2)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1)):
vite-plugin-svgr@4.5.0(rollup@4.60.1)(supports-color@7.2.0)(typescript@5.9.3)(vite@8.3.8(@types/node@26.6.11)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1)):
dependencies:
'@rollup/pluginutils': 5.3.0(rollup@4.60.1)
'@svgr/core': 8.1.0(supports-color@7.2.0)(typescript@5.9.3)
'@svgr/plugin-jsx': 8.1.0(@svgr/core@8.1.0(supports-color@7.2.0)(typescript@5.9.3))(supports-color@7.2.0)
vite: 8.3.8(@types/node@24.19.2)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1)
vite: 8.3.8(@types/node@26.6.11)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1)
transitivePeerDependencies:
- rollup
- supports-color
- typescript
vite-plugin-wasm@3.6.0(vite@8.3.8(@types/node@24.19.2)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1)):
vite-plugin-wasm@3.6.0(vite@8.3.8(@types/node@26.6.11)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1)):
dependencies:
vite: 8.3.8(@types/node@24.19.2)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1)
vite: 8.3.8(@types/node@26.6.11)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1)
vite@8.3.8(@types/node@24.19.2)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1):
vite@8.3.8(@types/node@26.6.11)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1):
dependencies:
lightningcss: 1.33.0
picomatch: 4.0.7
@@ -11544,7 +11544,7 @@ snapshots:
rolldown: 1.2.19
tinyglobby: 0.2.17
optionalDependencies:
'@types/node': 24.19.2
'@types/node': 26.6.11
esbuild: 0.28.2
fsevents: 2.3.3
jiti: 2.7.0
@@ -11558,12 +11558,12 @@ snapshots:
axe-core: 4.11.3
chalk: 5.6.2
lodash-es: 4.18.1
vitest: 4.1.12(@opentelemetry/api@1.9.1)(@types/node@24.19.2)(@vitest/browser-playwright@4.1.12)(@vitest/coverage-v8@4.1.12)(@vitest/ui@4.1.12)(jsdom@26.1.0(supports-color@7.2.0))(vite@8.3.8(@types/node@24.19.2)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1))
vitest: 4.1.12(@opentelemetry/api@1.9.1)(@types/node@26.6.11)(@vitest/browser-playwright@4.1.12)(@vitest/coverage-v8@4.1.12)(@vitest/ui@4.1.12)(jsdom@26.1.0(supports-color@7.2.0))(vite@8.3.8(@types/node@26.6.11)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1))
vitest@4.1.12(@opentelemetry/api@1.9.1)(@types/node@24.19.2)(@vitest/browser-playwright@4.1.12)(@vitest/coverage-v8@4.1.12)(@vitest/ui@4.1.12)(jsdom@26.1.0(supports-color@7.2.0))(vite@8.3.8(@types/node@24.19.2)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1)):
vitest@4.1.12(@opentelemetry/api@1.9.1)(@types/node@26.6.11)(@vitest/browser-playwright@4.1.12)(@vitest/coverage-v8@4.1.12)(@vitest/ui@4.1.12)(jsdom@26.1.0(supports-color@7.2.0))(vite@8.3.8(@types/node@26.6.11)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1)):
dependencies:
'@vitest/expect': 4.1.12
'@vitest/mocker': 4.1.12(vite@8.3.8(@types/node@24.19.2)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1))
'@vitest/mocker': 4.1.12(vite@8.3.8(@types/node@26.6.11)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1))
'@vitest/pretty-format': 4.1.12
'@vitest/runner': 4.1.12
'@vitest/snapshot': 4.1.12
@@ -11580,12 +11580,12 @@ snapshots:
tinyexec: 1.3.1
tinyglobby: 0.2.17
tinyrainbow: 3.2.0
vite: 8.3.8(@types/node@24.19.2)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1)
vite: 8.3.8(@types/node@26.6.11)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1)
why-is-node-running: 2.3.0
optionalDependencies:
'@opentelemetry/api': 1.9.1
'@types/node': 24.19.2
'@vitest/browser-playwright': 4.1.12(playwright@1.65.1)(vite@8.3.8(@types/node@24.19.2)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1))(vitest@4.1.12)
'@types/node': 26.6.11
'@vitest/browser-playwright': 4.1.12(playwright@1.65.1)(vite@8.3.8(@types/node@26.6.11)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1))(vitest@4.1.12)
'@vitest/coverage-v8': 4.1.12(@vitest/browser@4.1.12)(vitest@4.1.12)
'@vitest/ui': 4.1.12(vitest@4.1.12)
jsdom: 26.1.0(supports-color@7.2.0)
-9
View File
@@ -228,8 +228,6 @@ export interface MatrixRTCClientOptions {
timings?: Partial<SessionTimings>;
/** Limits on what is published; LiveKit's defaults otherwise. */
mediaQuality?: MediaQuality;
/** Whether remote video is received from the first connection on; true when left out. */
receiveVideo?: boolean;
/** Use this transport instead of asking the homeserver. */
transport?: Transport;
/** Use this transport when the homeserver advertises none of the backend's type. */
@@ -345,13 +343,6 @@ export interface MatrixRTCClient {
*/
setAudioOutputDeviceId(deviceId: string): Promise<void>;
/**
* Whether remote video is received. While false no remote video track is
* subscribed on any transport, including transports connected later and
* after a reconnection; audio is unaffected. Defaults to true.
*/
setReceiveVideo(receive: boolean): void;
/**
* Sends a short text to every member on the local transport, over a
* reliable data channel beside the media. A packet holds about 15 KiB;
-18
View File
@@ -105,7 +105,6 @@ interface FakeBackend {
connectionState$: BehaviorSubject<MediaConnectionState | Error>;
data$: Subject<DataPacket>;
setPublishing: Mock<(publish: boolean) => void>;
setReceiveVideo: Mock<(receive: boolean) => void>;
delegateDelayedLeave: Mock<(delayId: string) => Promise<void>>;
mediaFor: Mock<(scope: ObservableScope, member: RTCMember) => MemberMedia>;
}
@@ -153,7 +152,6 @@ function setup(
),
data$: new Subject<DataPacket>(),
setPublishing: vi.fn(),
setReceiveVideo: vi.fn(),
delegateDelayedLeave: vi.fn(async () => Promise.resolve()),
mediaFor: vi.fn(() => ({
tracks$: constant(null),
@@ -180,7 +178,6 @@ function setup(
mediaFor: fake.mediaFor,
connections$: constant([]),
setAudioOutputDeviceId: vi.fn(),
setReceiveVideo: fake.setReceiveVideo,
sendData: vi.fn(),
data$: fake.data$,
};
@@ -378,21 +375,6 @@ describe("createRTCParticipation", () => {
scope.end();
});
it("hands the receive video choice to the backend, from the join options on", () => {
const { participation, fake, scope } = setup({ receiveVideo: false });
expect(fake.setReceiveVideo.mock.calls).toEqual([[false]]);
participation.setReceiveVideo(true);
expect(fake.setReceiveVideo).toHaveBeenLastCalledWith(true);
scope.end();
});
it("leaves the backend receiving video when the join options say nothing", () => {
const { fake, scope } = setup();
expect(fake.setReceiveVideo).not.toHaveBeenCalled();
scope.end();
});
it("gives the backend the keys the session holds and the ones that follow", () => {
const { fake, session, mockedSession, scope } = setup();
const keys: MediaKey[] = [];
-2
View File
@@ -151,7 +151,6 @@ export function createRTCParticipation(
timings,
logger,
});
if (options.receiveVideo === false) backend.setReceiveVideo(false);
// If the backend is LiveKit, we check it for transports as well, as a
// fallback: another member's SFU may let us publish (MSC4195). LiveKit only,
@@ -321,7 +320,6 @@ export function createRTCParticipation(
connectedTransports$: transports.connected$,
setAudioOutputDeviceId: async (deviceId) =>
backend.setAudioOutputDeviceId(deviceId),
setReceiveVideo: (receive) => backend.setReceiveVideo(receive),
sendData: async (topic, text) => backend.sendData(topic, text),
data$,
},
-1
View File
@@ -92,7 +92,6 @@ function idleBackend(): MediaBackend {
mediaFor: vi.fn(),
connections$: constant([]),
setAudioOutputDeviceId: vi.fn(),
setReceiveVideo: vi.fn(),
sendData: vi.fn(),
data$: EMPTY,
};
-12
View File
@@ -127,11 +127,6 @@ export interface RTCParticipationOptions {
timings?: Partial<SessionTimings>;
/** Limits on what is published; LiveKit's defaults otherwise. */
mediaQuality?: MediaQuality;
/**
* Whether remote video is received from the first connection on, as
* `setReceiveVideo` would set it. True when left out.
*/
receiveVideo?: boolean;
/**
* Use this transport instead of asking the homeserver. Any shape the
* backend serves: for LiveKit a `url`, a `livekit_service_url` or both.
@@ -221,13 +216,6 @@ export interface RTCParticipation {
*/
setAudioOutputDeviceId(deviceId: string): Promise<void>;
/**
* Whether remote video is received. While false no remote video track is
* subscribed on any transport, including transports connected later and
* after a reconnection; audio is unaffected. Defaults to true.
*/
setReceiveVideo(receive: boolean): void;
/**
* Sends a short text to every member on the local transport, over a
* reliable data channel beside the media. A packet holds about 15 KiB;
-7
View File
@@ -159,13 +159,6 @@ export interface MediaBackend {
*/
setAudioOutputDeviceId(deviceId: string): Promise<void>;
/**
* Whether remote video is subscribed. Remembered across connections: every
* connection, existing or created later, follows it, including after a
* reconnection. Audio is always subscribed. True until first set.
*/
setReceiveVideo(receive: boolean): void;
/**
* A text channel beside the media: sent on the local transport, received on every one.
* This could well be just another track kind. Not needed for element call. just for the sdk target.
@@ -28,7 +28,6 @@ import {
} from "livekit-client";
import fetchMock from "fetch-mock";
import EventEmitter from "events";
import { BehaviorSubject } from "rxjs";
import { MatrixError } from "matrix-js-sdk";
import { logger, type Logger } from "matrix-js-sdk/lib/logger";
import {
@@ -53,7 +52,6 @@ let testScope: ObservableScope;
let client: MockedObject<ClientGetTokenParts & ClientOpenIDParts>;
let fakeLivekitRoom: MockedObject<LivekitRoom>;
let receiveVideo$: BehaviorSubject<boolean>;
let localParticipantEventEmiter: EventEmitter;
let fakeLocalParticipant: MockedObject<LocalParticipant>;
@@ -81,14 +79,12 @@ function connectionOpts(): ConnectionOpts {
serverName: "m.localhost",
scope: testScope,
ownMembershipIdentity: ownMemberMock,
receiveVideo$,
livekitRoomFactory: () => fakeLivekitRoom,
};
}
function setupTest(): void {
testScope = new ObservableScope();
receiveVideo$ = new BehaviorSubject(true);
client = vi.mocked<ClientGetTokenParts & ClientOpenIDParts>({
getOpenIdToken: vi.fn().mockResolvedValue({
access_token: "rYsmGUEwNjKgJYyeNUkZseJN",
@@ -387,7 +383,6 @@ describe("Start connection states", () => {
expect(fakeLivekitRoom.connect).toHaveBeenCalledWith(
"wss://sfu",
testJWTToken,
{ autoSubscribe: true },
);
expect(connection.livekitAlias).toBe("!example_room_id");
});
@@ -621,169 +616,6 @@ describe("remote participants", () => {
});
});
describe("receiving video", () => {
it("connects without subscribing while video is not received", async () => {
setupTest();
receiveVideo$.next(false);
const connection = setupRemoteConnection();
await connection.start();
expect(fakeLivekitRoom.connect).toHaveBeenCalledWith(
expect.any(String),
expect.any(String),
{ autoSubscribe: false },
);
});
it("subscribes audio and not video as tracks are published", () => {
setupTest();
receiveVideo$.next(false);
new Connection(connectionOpts(), logger);
const { bob, publications } = remoteParticipantWithTracks(undefined);
for (const publication of Object.values(publications))
fakeLivekitRoom.emit(RoomEvent.TrackPublished, publication, bob);
expect(subscriptions(publications)).toEqual(VIDEO_OFF);
});
it("unsubscribes the video of a participant who connects while video is not received", () => {
setupTest();
receiveVideo$.next(false);
new Connection(connectionOpts(), logger);
// Published under autoSubscribe, as after a full reconnect
const { bob, publications } = remoteParticipantWithTracks(undefined);
fakeLivekitRoom.emit(RoomEvent.ParticipantConnected, bob);
expect(subscriptions(publications)).toEqual(VIDEO_OFF);
});
it.each([RoomEvent.Connected, RoomEvent.Reconnected])(
"sweeps every remote publication on %s",
(event) => {
setupTest();
receiveVideo$.next(false);
new Connection(connectionOpts(), logger);
const { publications } = remoteParticipantWithTracks(undefined);
fakeLivekitRoom.emit(event);
expect(subscriptions(publications)).toEqual(VIDEO_OFF);
},
);
it("follows every change of the choice, without resending what is already asked", () => {
setupTest();
new Connection(connectionOpts(), logger);
const { publications } = remoteParticipantWithTracks(undefined);
receiveVideo$.next(false);
expect(subscriptions(publications)).toEqual(VIDEO_OFF);
expect(publications.microphone.setSubscribed).not.toHaveBeenCalled();
receiveVideo$.next(true);
expect(subscriptions(publications)).toEqual(VIDEO_ON);
});
it("subscribes video again on a connection made while video was not received", () => {
setupTest();
receiveVideo$.next(false);
new Connection(connectionOpts(), logger);
// Published under autoSubscribe: false
const { publications } = remoteParticipantWithTracks(false);
fakeLivekitRoom.emit(RoomEvent.Connected);
expect(subscriptions(publications)).toEqual(VIDEO_OFF);
receiveVideo$.next(true);
expect(subscriptions(publications)).toEqual(VIDEO_ON);
});
it("stops following the choice once its scope ends", () => {
setupTest();
new Connection(connectionOpts(), logger);
const { publications } = remoteParticipantWithTracks(undefined);
testScope.end();
receiveVideo$.next(false);
fakeLivekitRoom.emit(RoomEvent.Reconnected);
expect(subscriptions(publications)).toEqual(VIDEO_ON);
});
});
const VIDEO_OFF = {
microphone: true,
camera: false,
screenShare: false,
screenShareAudio: true,
};
const VIDEO_ON = {
microphone: true,
camera: true,
screenShare: true,
screenShareAudio: true,
};
type MockPublication = RemoteTrackPublication & {
setSubscribed: ReturnType<typeof vi.fn>;
};
type Publications = Record<keyof typeof VIDEO_ON, MockPublication>;
/**
* Bob in the room with a microphone, a camera and a screen share with audio,
* each with the subscription LiveKit gave it: undefined under autoSubscribe.
*/
function remoteParticipantWithTracks(subscribed: boolean | undefined): {
bob: RemoteParticipant;
publications: Publications;
} {
const publications: Publications = {
microphone: mockPublication(Track.Kind.Audio, subscribed),
camera: mockPublication(Track.Kind.Video, subscribed),
screenShare: mockPublication(Track.Kind.Video, subscribed),
screenShareAudio: mockPublication(Track.Kind.Audio, subscribed),
};
const bob = mockRemoteParticipant({
identity: "@bob:example.org:DEV111",
trackPublications: new Map(
Object.entries(publications) as [string, RemoteTrackPublication][],
),
});
fakeLivekitRoom.remoteParticipants.set(bob.identity, bob);
return { bob, publications };
}
function mockPublication(
kind: Track.Kind,
subscribed: boolean | undefined,
): MockPublication {
const publication = {
kind,
subscribed,
get isDesired(): boolean {
return this.subscribed !== false;
},
setSubscribed: vi.fn((value: boolean) => {
publication.subscribed = value;
}),
};
return publication as unknown as MockPublication;
}
function subscriptions(
publications: Publications,
): Record<keyof Publications, boolean> {
return Object.fromEntries(
Object.entries(publications).map(([name, publication]) => [
name,
publication.isDesired,
]),
) as Record<keyof Publications, boolean>;
}
describe("remote track logging", () => {
it("logs remote participant and track events on the connection logger", () => {
setupTest();
+4 -57
View File
@@ -19,14 +19,13 @@ import {
type RemoteParticipant,
type RemoteTrackPublication,
type Room as LivekitRoom,
type RoomConnectOptions,
RoomEvent,
type SubscriptionError,
Track,
type Track,
type TrackPublication,
} from "livekit-client";
import { type UnstableLivekitTransport } from "matrix-js-sdk/lib/matrixrtc";
import { BehaviorSubject, distinctUntilChanged, skip } from "rxjs";
import { BehaviorSubject } from "rxjs";
import { type Logger } from "matrix-js-sdk/lib/logger";
import { type CallMembershipIdentityParts } from "matrix-js-sdk/lib/matrixrtc/EncryptionManager";
@@ -65,11 +64,6 @@ export interface ConnectionOpts {
slotId: string;
/** The observable scope to use for this connection. */
scope: ObservableScope;
/**
* Whether remote video is subscribed. Read at connect and followed for the
* connection's lifetime; audio is always subscribed.
*/
receiveVideo$: Behavior<boolean>;
/** Optional factory to create the LiveKit room, mainly for testing purposes. */
livekitRoomFactory: () => LivekitRoom;
@@ -144,7 +138,6 @@ export class Connection {
private readonly slotId: string;
private readonly logger: Logger;
private readonly ownMembershipIdentity: CallMembershipIdentityParts;
private readonly receiveVideo$: Behavior<boolean>;
/**
* Creates a new connection to a matrix RTC LiveKit backend.
*
@@ -168,14 +161,12 @@ export class Connection {
this.transport = transport;
this.serverName = serverName;
this.client = client;
this.receiveVideo$ = opts.receiveVideo$;
this.remoteParticipants$ = scope.behavior(
// Only tracks remote participants
connectedParticipantsObserver(this.livekitRoom),
);
this.logRemoteTrackEvents();
this.applyReceivePolicy();
scope.onEnd(() => {
this.logger.info(`Connection scope ended, stopping connection`);
@@ -183,45 +174,6 @@ export class Connection {
});
}
/**
* Keeps every remote publication subscribed or not as `receiveVideo$` asks.
* A full reconnect recreates the remote participants with the subscriptions
* the room first connected with, and events for participants already in the
* room are not emitted while it connects, so the whole room is swept again
* on `Connected` and `Reconnected`.
*/
private applyReceivePolicy(): void {
const room = this.livekitRoom;
const reconcile = (publication: RemoteTrackPublication): void => {
const wanted =
publication.kind !== Track.Kind.Video || this.receiveVideo$.value;
// Every call sends a subscription update, wanted or not
if (publication.isDesired !== wanted) publication.setSubscribed(wanted);
};
const reconcileParticipant = (participant: RemoteParticipant): void =>
participant.trackPublications.forEach(reconcile);
const reconcileAll = (): void =>
room.remoteParticipants.forEach(reconcileParticipant);
const onTrackPublished = (publication: RemoteTrackPublication): void =>
reconcile(publication);
room
.on(RoomEvent.TrackPublished, onTrackPublished)
.on(RoomEvent.ParticipantConnected, reconcileParticipant)
.on(RoomEvent.Connected, reconcileAll)
.on(RoomEvent.Reconnected, reconcileAll);
this.receiveVideo$
.pipe(distinctUntilChanged(), skip(1), this.scope.bind())
.subscribe(reconcileAll);
this.scope.onEnd(() => {
room
.off(RoomEvent.TrackPublished, onTrackPublished)
.off(RoomEvent.ParticipantConnected, reconcileParticipant)
.off(RoomEvent.Connected, reconcileAll)
.off(RoomEvent.Reconnected, reconcileAll);
});
}
/**
* Logs the lifecycle of remote participants and their tracks as seen by
* livekit-client, so that rageshakes show what a tile should have been
@@ -433,7 +385,7 @@ export class Connection {
private async connectLivekitRoom(url: string, jwt: string): Promise<void> {
try {
await this.livekitRoom.connect(url, jwt, this.connectOptions());
await this.livekitRoom.connect(url, jwt);
} catch (e) {
// Behind a proxy, Firefox fails the first WebSocket to a host after trying
// it over HTTP/2, so a join that fails on the WebSocket gets a second try.
@@ -444,15 +396,10 @@ export class Connection {
e.reason === ConnectionErrorReason.WebSocket;
if (this.stopped || !failedOnFirefoxWebSocket) throw e;
this.logger.info(`livekitRoom.connect RETRY ${url}`, e);
await this.livekitRoom.connect(url, jwt, this.connectOptions());
await this.livekitRoom.connect(url, jwt);
}
}
/** A connection made while video is not received never asks the SFU for it. */
private connectOptions(): RoomConnectOptions {
return { autoSubscribe: this.receiveVideo$.value };
}
protected async getSFUConfig(): Promise<SFUConfig> {
return await getSFUConfig({
client: this.client,
@@ -7,19 +7,15 @@ Please see LICENSE in the repository root for full details.
import {
ConnectionState as LivekitConnectionState,
type RemoteParticipant,
type RemoteTrackPublication,
type RoomOptions,
Track,
} from "livekit-client";
import { BehaviorSubject } from "rxjs";
import { logger } from "matrix-js-sdk/lib/logger";
import { type UnstableLivekitTransport } from "matrix-js-sdk/lib/matrixrtc";
import { describe, expect, it, vi } from "vitest";
import { type MediaQuality } from "../../config";
import { type PublishRequest } from "../../media-api";
import { type Behavior, constant } from "../../reactive/Behavior";
import { constant } from "../../reactive/Behavior";
import { ownMemberMock, testScope } from "../../utils/test";
import { testJWTToken } from "../../utils/test-fixtures";
import { type ClientGetTokenParts, type ClientOpenIDParts } from "./auth";
@@ -51,7 +47,6 @@ function create(
mediaQuality?: MediaQuality,
audioOutputDeviceId?: string,
transport = exampleTransport,
receiveVideo$: Behavior<boolean> = constant(true),
): { connection: ResolvedConnection; options: RoomOptions } {
const factory = new LivekitConnectionFactory(
client(),
@@ -59,7 +54,6 @@ function create(
"m.call#ROOM",
publish,
constant(audioOutputDeviceId),
receiveVideo$,
undefined,
mediaQuality,
);
@@ -75,29 +69,6 @@ function create(
}
describe("LivekitConnectionFactory", () => {
it("gives each connection the receive video choice to follow", () => {
const receiveVideo$ = new BehaviorSubject(true);
const { connection } = create(
[],
undefined,
undefined,
undefined,
receiveVideo$,
);
const camera = {
kind: Track.Kind.Video,
isDesired: true,
setSubscribed: vi.fn(),
} as unknown as RemoteTrackPublication;
connection.livekitRoom.remoteParticipants.set("@bob:example.org:DEV", {
trackPublications: new Map([["camera", camera]]),
} as unknown as RemoteParticipant);
receiveVideo$.next(false);
expect(camera.setSubscribed).toHaveBeenCalledWith(false);
});
it("builds the room on the defaults where nothing is requested", () => {
const { options } = create([]);
@@ -106,7 +106,6 @@ export class LivekitConnectionFactory implements ConnectionFactory {
private readonly slotId: string,
private readonly publish: PublishRequest[],
private readonly audioOutputDeviceId$: Behavior<string | undefined>,
private readonly receiveVideo$: Behavior<boolean>,
private readonly keyProvider: BaseKeyProvider | undefined,
private readonly mediaQuality: MediaQuality | undefined,
) {}
@@ -128,7 +127,6 @@ export class LivekitConnectionFactory implements ConnectionFactory {
serverName,
client: this.client,
scope,
receiveVideo$: this.receiveVideo$,
livekitRoomFactory: () =>
new LivekitRoom(
roomOptions(
@@ -169,10 +169,6 @@ describe("createLivekitBackend", () => {
participants$: BehaviorSubject<RemoteParticipant[]>;
state$: BehaviorSubject<ConnectionState>;
}[];
/** What the backend built the factory with. */
let factoryArgs: ConstructorParameters<
typeof connectionFactory.LivekitConnectionFactory
>;
const connected: ConnectionState = {
state: "authenticated",
livekitState: LivekitConnectionState.Connected,
@@ -181,13 +177,7 @@ describe("createLivekitBackend", () => {
/** Stands in for the factory: connections whose state and participants the test drives. */
function stubFactory(initialState: ConnectionState): void {
vi.spyOn(connectionFactory, "LivekitConnectionFactory").mockImplementation(
function (
this: unknown,
...args: ConstructorParameters<
typeof connectionFactory.LivekitConnectionFactory
>
) {
factoryArgs = args;
function (this: unknown) {
return {
createConnection: (
scope: ObservableScope,
@@ -268,17 +258,6 @@ describe("createLivekitBackend", () => {
},
);
it("hands every connection the factory makes the receive video choice, true until set", () => {
const b = backend();
const receiveVideo$ = factoryArgs[5];
expect(receiveVideo$.value).toBe(true);
b.setReceiveVideo(false);
expect(receiveVideo$.value).toBe(false);
b.setReceiveVideo(true);
expect(receiveVideo$.value).toBe(true);
});
it("prepares a remote SFU's transport on its homeserver, where delegation is not possible", async () => {
// Our own homeserver would delegate, so only the SFU being remote can
// explain delegation being skipped
@@ -107,14 +107,12 @@ export function createLivekitBackend(
const audioOutputDeviceId$ = new BehaviorSubject<string | undefined>(
undefined,
);
const receiveVideo$ = new BehaviorSubject(true);
const connectionFactory = new LivekitConnectionFactory(
client,
roomId,
slotId,
publish,
audioOutputDeviceId$,
receiveVideo$,
keyProvider,
mediaQuality,
);
@@ -289,7 +287,6 @@ export function createLivekitBackend(
mediaFor,
connections$,
setAudioOutputDeviceId: localMedia_.setAudioOutputDeviceId,
setReceiveVideo: (receive) => receiveVideo$.next(receive),
sendData,
data$,
};
-1
View File
@@ -32,7 +32,6 @@ export function mockRemoteParticipant(
({}) as Partial<RemoteTrackPublication> as RemoteTrackPublication,
// this will only get used for `getTrackPublications().length`
getTrackPublications: () => [0],
trackPublications: new Map(),
...mockEmitter(),
...participant,
} as RemoteParticipant;
@@ -537,7 +537,9 @@ export const RemovingWithLiveSelection: Story = {
const cross = tile.parentElement!.querySelector<HTMLElement>(
"[aria-hidden]:last-child",
)!;
await expect(cross).toBeVisible();
// The menu slides in over 180ms from transparent. On a fast machine the
// hover lands before its first frame, so wait it out.
await waitFor(async () => expect(cross).toBeVisible());
await userEvent.click(cross);
await waitFor(async () =>
@@ -907,7 +909,10 @@ export const SelectionSettling: Story = {
await menu.findByRole("menuitemradio", { name: "Microphone 2" }),
);
await expect(await menu.findByLabelText("Activating…")).toBeVisible();
// The menu slides in over 180ms from transparent. On a fast machine the
// hover lands before its first frame, so wait it out.
const spinner = await menu.findByLabelText("Activating…");
await waitFor(async () => expect(spinner).toBeVisible());
for (const item of menu.getAllByRole("menuitemradio"))
await expect(item).toHaveAttribute("aria-disabled", "true");
},
+1 -15
View File
@@ -73,10 +73,6 @@ import { useMuteStates } from "../state/useMuteStates.ts";
import { useLeaveToHome } from "../LeaveToHomeContext.ts";
import { useLocalMedia } from "../useLocalMedia.ts";
import { ObservableScope } from "../state/ObservableScope.ts";
import {
createLowBandwidthMode,
type LowBandwidthMode,
} from "../state/LowBandwidthMode.ts";
import { type CallNotificationWrapper } from "../state/CallViewModel/CallNotificationLifecycle.ts";
import { type CallMatrixBackend } from "../CallMatrixBackend.ts";
@@ -150,9 +146,6 @@ export const CallView: FC<Props> = ({
// rebuilt.
const [joined, setJoined] = useState(false);
const muteStates = useMuteStates();
// Held here too, so that it survives the call failing and being
// reconnected. The lobby starts every new call with it off
const [lowBandwidthMode] = useState(createLowBandwidthMode);
const e2eeSystem = useRoomEncryptionSystem(backend.roomId);
// One slot for every join of this call: leaving and joining again, to
@@ -187,7 +180,6 @@ export const CallView: FC<Props> = ({
joined={joined}
setJoined={setJoined}
muteStates={muteStates}
lowBandwidthMode={lowBandwidthMode}
/>
);
};
@@ -257,7 +249,6 @@ interface LoadedProps extends Omit<Props, "rtcSession" | "backend"> {
joined: boolean;
setJoined: (value: boolean) => void;
muteStates: MuteStates;
lowBandwidthMode: LowBandwidthMode;
}
/**
@@ -290,7 +281,6 @@ const LoadedCallView: FC<LoadedProps> = ({
joined,
setJoined,
muteStates,
lowBandwidthMode,
}) => {
// Used to thread through any errors that occur outside the error boundary
const [externalError, setExternalError] = useState<ElementCallError | null>(
@@ -597,10 +587,7 @@ const LoadedCallView: FC<LoadedProps> = ({
matrixInfo={matrixInfo}
media={media}
muteStates={muteStates}
onEnter={() => {
lowBandwidthMode.reset();
setJoined(true);
}}
onEnter={() => setJoined(true)}
confineToRoom={confineToRoom}
hideHeader={header !== HeaderStyle.Standard}
participantCount={participantCount}
@@ -631,7 +618,6 @@ const LoadedCallView: FC<LoadedProps> = ({
onLeft={onLeft}
media={media}
muteStates={muteStates}
lowBandwidthMode={lowBandwidthMode}
e2eeSystem={e2eeSystem}
//otelGroupCallMembership={otelGroupCallMembership}
onShareClick={onShareClick}
-3
View File
@@ -21,7 +21,6 @@ import { TooltipProvider } from "@vector-im/compound-web";
import userEvent from "@testing-library/user-event";
import { ActiveCall, InCallView } from "./InCallView";
import { createLowBandwidthMode } from "../state/LowBandwidthMode";
import {
mockMediaDevices,
mockMuteStates,
@@ -243,7 +242,6 @@ function renderActiveCall(slot: RTCSlot): RenderResult {
sentCallNotification$={NEVER}
matrixRoom={matrixRoom}
muteStates={mockMuteStates()}
lowBandwidthMode={createLowBandwidthMode()}
matrixInfo={matrixInfo}
onShareClick={null}
e2eeSystem={{ kind: E2eeType.NONE }}
@@ -313,7 +311,6 @@ describe("ActiveCall", () => {
sentCallNotification$={NEVER}
matrixRoom={matrixRoom}
muteStates={mockMuteStates()}
lowBandwidthMode={createLowBandwidthMode()}
matrixInfo={matrixInfo}
onShareClick={null}
e2eeSystem={{ kind: E2eeType.NONE }}
+1 -9
View File
@@ -41,7 +41,6 @@ import { RageshakeRequestModal } from "./RageshakeRequestModal";
import { useWakeLock } from "../useWakeLock";
import { useMergedRefs } from "../useMergedRefs";
import { type MuteStates } from "../state/MuteStates";
import { type LowBandwidthMode } from "../state/LowBandwidthMode";
import { type MatrixInfo } from "./VideoPreview";
import { InviteButton } from "../button/InviteButton";
import {
@@ -195,7 +194,6 @@ export interface ActiveCallProps extends Omit<
e2eeSystem: EncryptionSystem;
/** The tracks the lobby opened, for the join to publish. */
media: LocalMedia;
lowBandwidthMode: LowBandwidthMode;
// TODO refactor those reasons into an enum
onLeft: (
reason: "user" | "timeout" | "decline" | "allOthersLeft" | "error",
@@ -232,7 +230,6 @@ export const ActiveCall: FC<ActiveCallProps> = (props) => {
const capture = captureSettings();
const rtcParticipation = props.slot.join({
...rtcParticipationOptions(urlParams),
receiveVideo: !props.lowBandwidthMode.enabled$.value,
// Without a lobby nothing was captured and the join captures itself
publish:
props.media.requests.length > 0
@@ -253,7 +250,6 @@ export const ActiveCall: FC<ActiveCallProps> = (props) => {
client: props.client,
mediaDevices,
muteStates: props.muteStates,
lowBandwidthMode: props.lowBandwidthMode,
encryptionSystem: props.e2eeSystem,
viewSize$: scope.behavior(observeElementSize$(rootElement)),
handsRaisedSubject$: reactionsReader.raisedHands$,
@@ -286,7 +282,6 @@ export const ActiveCall: FC<ActiveCallProps> = (props) => {
props.sentCallNotification$,
props.matrixRoom,
props.muteStates,
props.lowBandwidthMode,
props.e2eeSystem,
props.onLeft,
urlParams,
@@ -312,9 +307,7 @@ export const ActiveCall: FC<ActiveCallProps> = (props) => {
{ showControls: urlParams.showControls, header: urlParams.header },
);
setFooterVm(footerVm);
setDeveloperSettingsVm(
createDeveloperSettingsTabViewModel(scope, vm, props.lowBandwidthMode),
);
setDeveloperSettingsVm(createDeveloperSettingsTabViewModel(scope, vm));
return (): void => {
scope.end();
@@ -322,7 +315,6 @@ export const ActiveCall: FC<ActiveCallProps> = (props) => {
}, [
props.matrixRoom,
props.muteStates,
props.lowBandwidthMode,
props.e2eeSystem,
props.onLeft,
urlParams,
@@ -429,7 +429,6 @@ describe("DeveloperSettingsTab", () => {
const client = createMockMatrixClient();
const vm = createStaticViewModel<DeveloperSettingsSnapshot>({
keyRotation: { suppressed: false, participantCount: 5 },
lowBandwidthMode: null,
});
render(
@@ -453,7 +452,6 @@ describe("DeveloperSettingsTab", () => {
const client = createMockMatrixClient();
const vm = createStaticViewModel<DeveloperSettingsSnapshot>({
keyRotation: { suppressed: true, participantCount: 50 },
lowBandwidthMode: null,
});
render(
@@ -495,48 +493,4 @@ describe("DeveloperSettingsTab", () => {
);
});
});
describe("Low bandwidth mode", () => {
it("is a switch for the call, while in one", async () => {
const user = userEvent.setup();
const setEnabled = vi.fn();
render(
<TooltipProvider>
<DeveloperSettingsTab
client={createMockMatrixClient()}
env={{} as unknown as ImportMetaEnv}
vm={createStaticViewModel<DeveloperSettingsSnapshot>({
keyRotation: null,
lowBandwidthMode: { enabled: false, setEnabled },
})}
/>
</TooltipProvider>,
);
const toggle = screen.getByRole("checkbox", {
name: "Low bandwidth mode",
});
expect(toggle).not.toBeChecked();
expect(toggle).toHaveAccessibleDescription(
"Stop all video for this call, so that audio keeps flowing on a slow network. Lasts until the call ends.",
);
await user.click(toggle);
expect(setEnabled).toHaveBeenCalledWith(true);
});
it("is not offered outside a call", () => {
render(
<TooltipProvider>
<DeveloperSettingsTab
client={createMockMatrixClient()}
env={{} as unknown as ImportMetaEnv}
vm={outOfCallDeveloperSettingsTabViewModel}
/>
</TooltipProvider>,
);
expect(
screen.queryByRole("checkbox", { name: "Low bandwidth mode" }),
).toBeNull();
});
});
});
-21
View File
@@ -97,11 +97,6 @@ export interface KeyRotationInfo {
export interface DeveloperSettingsSnapshot {
/** The media key rotation state, or `null` when we are not in a call. */
keyRotation: KeyRotationInfo | null;
/** The call's low bandwidth mode, or `null` when we are not in a call. */
lowBandwidthMode: {
enabled: boolean;
setEnabled: (enabled: boolean) => void;
} | null;
}
/**
@@ -146,7 +141,6 @@ export const DeveloperSettingsTab: FC<Props> = ({
}) => {
const { t } = useTranslation();
const keyRotation = useBehavior(vm.keyRotation$);
const lowBandwidthMode = useBehavior(vm.lowBandwidthMode$);
const [duplicateTiles, setDuplicateTiles] = useSetting(duplicateTilesSetting);
const [debugTileLayout, setDebugTileLayout] = useSetting(
debugTileLayoutSetting,
@@ -416,21 +410,6 @@ export const DeveloperSettingsTab: FC<Props> = ({
</p>
{keyRotation !== null && <KeyRotationStatus info={keyRotation} />}
<Separator />
{/* Null outside a call (the lobby, the user menu): the mode belongs to a call */}
{lowBandwidthMode !== null && (
<FieldRow>
<InputField
id="lowBandwidthMode"
type="checkbox"
label={t("low_bandwidth_mode.switch_label")}
description={t("low_bandwidth_mode.switch_description")}
checked={lowBandwidthMode.enabled}
onChange={(event: ChangeEvent<HTMLInputElement>): void =>
lowBandwidthMode.setEnabled(event.target.checked)
}
/>
</FieldRow>
)}
<FieldRow>
<InputField
id="duplicateTiles"
@@ -9,7 +9,6 @@ import { describe, expect, it } from "vitest";
import { BehaviorSubject } from "rxjs";
import { testScope } from "../utils/test";
import { createLowBandwidthMode } from "../state/LowBandwidthMode";
import { type CallViewModel } from "../state/CallViewModel/CallViewModel";
import {
createDeveloperSettingsTabViewModel,
@@ -20,11 +19,10 @@ describe("createDeveloperSettingsTabViewModel", () => {
it("projects the key rotation state of the call", () => {
const keyRotationSuppressed$ = new BehaviorSubject(false);
const participantCount$ = new BehaviorSubject(5);
const vm = createDeveloperSettingsTabViewModel(
testScope(),
{ keyRotationSuppressed$, participantCount$ } as unknown as CallViewModel,
createLowBandwidthMode(),
);
const vm = createDeveloperSettingsTabViewModel(testScope(), {
keyRotationSuppressed$,
participantCount$,
} as unknown as CallViewModel);
expect(vm.keyRotation$.value).toEqual({
suppressed: false,
@@ -39,35 +37,9 @@ describe("createDeveloperSettingsTabViewModel", () => {
participantCount: 50,
});
});
it("has a switch reflecting the call's low bandwidth mode", () => {
const mode = createLowBandwidthMode();
const vm = createDeveloperSettingsTabViewModel(
testScope(),
{
keyRotationSuppressed$: new BehaviorSubject(false),
participantCount$: new BehaviorSubject(1),
} as unknown as CallViewModel,
mode,
);
expect(vm.lowBandwidthMode$.value?.enabled).toBe(false);
vm.lowBandwidthMode$.value!.setEnabled(true);
expect(mode.enabled$.value).toBe(true);
expect(vm.lowBandwidthMode$.value?.enabled).toBe(true);
mode.setEnabled(false);
expect(vm.lowBandwidthMode$.value?.enabled).toBe(false);
});
});
describe("outOfCallDeveloperSettingsTabViewModel", () => {
it("has no low bandwidth mode switch", () => {
expect(outOfCallDeveloperSettingsTabViewModel.lowBandwidthMode$.value).toBe(
null,
);
});
it("has no key rotation state", () => {
expect(outOfCallDeveloperSettingsTabViewModel.keyRotation$.value).toBe(
null,
+2 -16
View File
@@ -5,10 +5,9 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
Please see LICENSE in the repository root for full details.
*/
import { combineLatest, map } from "rxjs";
import { combineLatest } from "rxjs";
import { type CallViewModel } from "../state/CallViewModel/CallViewModel.ts";
import { type LowBandwidthMode } from "../state/LowBandwidthMode.ts";
import { type ObservableScope } from "../state/ObservableScope.ts";
import { createStaticViewModel, type ViewModel } from "../state/ViewModel.ts";
import { type DeveloperSettingsSnapshot } from "./DeveloperSettingsTab.tsx";
@@ -21,22 +20,12 @@ import { type DeveloperSettingsSnapshot } from "./DeveloperSettingsTab.tsx";
*
* @param scope - ObservableScope that bounds the lifetime of derived behaviors.
* @param callModel - The root CallViewModel; provides the key rotation state.
* @param lowBandwidthMode - The call's low bandwidth mode, for its switch.
*/
export function createDeveloperSettingsTabViewModel(
scope: ObservableScope,
callModel: CallViewModel,
lowBandwidthMode: LowBandwidthMode,
): ViewModel<DeveloperSettingsSnapshot> {
return {
lowBandwidthMode$: scope.behavior(
lowBandwidthMode.enabled$.pipe(
map((enabled) => ({
enabled,
setEnabled: lowBandwidthMode.setEnabled,
})),
),
),
keyRotation$: scope.behavior(
combineLatest(
[callModel.keyRotationSuppressed$, callModel.participantCount$],
@@ -51,7 +40,4 @@ export function createDeveloperSettingsTabViewModel(
* menu), where no call state exists. All call specific fields are `null`.
*/
export const outOfCallDeveloperSettingsTabViewModel: ViewModel<DeveloperSettingsSnapshot> =
createStaticViewModel<DeveloperSettingsSnapshot>({
keyRotation: null,
lowBandwidthMode: null,
});
createStaticViewModel<DeveloperSettingsSnapshot>({ keyRotation: null });
@@ -75,10 +75,6 @@ import {
type VideoProcessor,
} from "@element-hq/matrixrtc-sdk";
import { type BackgroundEffectsState } from "../BackgroundEffects";
import { createLowBandwidthMode } from "../LowBandwidthMode.ts";
import { type MediaViewModel } from "../media/MediaViewModel.ts";
import { type RemoteScreenShareViewModel } from "../media/RemoteScreenShareViewModel.ts";
import { type UserMediaViewModel } from "../media/UserMediaViewModel.ts";
initializeWidget();
@@ -1901,154 +1897,3 @@ describe("a camera with a video processor", () => {
expect(participation!.publish).not.toHaveBeenCalled();
});
});
describe("low bandwidth mode", () => {
const withCallViewModel = withCallViewModelInMode(MatrixRTCMode.Matrix_2_0);
const onOff = { y: true, n: false };
test("stops and resumes receiving video as the mode is turned on and off", () => {
const lowBandwidthMode = createLowBandwidthMode();
withCallViewModel(
{ lowBandwidthMode },
(_vm, _session, { rtcParticipation }) => {
expect(rtcParticipation.setReceiveVideo).toHaveBeenLastCalledWith(true);
lowBandwidthMode.setEnabled(true);
expect(rtcParticipation.setReceiveVideo).toHaveBeenLastCalledWith(
false,
);
lowBandwidthMode.setEnabled(false);
expect(rtcParticipation.setReceiveVideo).toHaveBeenLastCalledWith(true);
},
);
});
test("shows a camera that is still sending as off while on", () => {
withTestScheduler(({ schedule, expectObservable }) => {
const lowBandwidthMode = createLowBandwidthMode();
withCallViewModel(
{
lowBandwidthMode,
// Three, for the grid
remoteParticipants$: constant([aliceParticipant, bobParticipant]),
rtcMembers$: constant([localRtcMember, aliceRtcMember, bobRtcMember]),
videoEnabled: new Map([[aliceParticipant, constant(true)]]),
},
(vm) => {
schedule("-yn", {
y: () => lowBandwidthMode.setEnabled(true),
n: () => lowBandwidthMode.setEnabled(false),
});
expectObservable(
gridMedia$(vm.layout$, `${aliceId}:0`).pipe(
switchMap((media) => media?.videoEnabled$ ?? NEVER),
distinctUntilChanged(),
),
).toBe("yny", onOff);
},
);
});
});
test("keeps a remote screen share on the stage, without its picture, while on", () => {
withTestScheduler(({ schedule, expectObservable }) => {
const lowBandwidthMode = createLowBandwidthMode();
withCallViewModel(
{
lowBandwidthMode,
remoteParticipants$: constant([aliceParticipant]),
rtcMembers$: constant([localRtcMember, aliceRtcMember]),
sharingScreen: new Map([[aliceParticipant, constant(true)]]),
},
(vm) => {
schedule("-yn", {
y: () => lowBandwidthMode.setEnabled(true),
n: () => lowBandwidthMode.setEnabled(false),
});
const share$ = spotlightMedia$(
vm.layout$,
`${aliceId}:0:screen-share`,
);
expectObservable(
share$.pipe(
map((share) => share !== undefined),
distinctUntilChanged(),
),
).toBe("y", onOff);
expectObservable(
share$.pipe(
switchMap(
(share) =>
(share as RemoteScreenShareViewModel | undefined)
?.videoEnabled$ ?? NEVER,
),
distinctUntilChanged(),
),
).toBe("yny", onOff);
},
);
});
});
test("leaves a blank share out of the picture-in-picture window while on", () => {
withTestScheduler(({ schedule, expectObservable }) => {
const lowBandwidthMode = createLowBandwidthMode();
withCallViewModel(
{
lowBandwidthMode,
remoteParticipants$: constant([aliceParticipant]),
rtcMembers$: constant([localRtcMember, aliceRtcMember]),
sharingScreen: new Map([[aliceParticipant, constant(true)]]),
},
(vm) => {
schedule("-pyn", {
p: () => window.controls.enablePip(),
y: () => lowBandwidthMode.setEnabled(true),
n: () => lowBandwidthMode.setEnabled(false),
});
onTestFinished(() => window.controls.disablePip());
expectObservable(summarizeLayout$(vm.layout$)).toBe("abcb", {
a: {
type: "spotlight-landscape",
spotlight: [`${aliceId}:0:screen-share`],
grid: [`${localId}:0`, `${aliceId}:0`],
},
b: { type: "pip", spotlight: [`${aliceId}:0:screen-share`] },
c: { type: "pip", spotlight: [`${aliceId}:0`] },
});
},
);
});
});
function gridMedia$(
layout$: Observable<Layout>,
id: string,
): Observable<UserMediaViewModel | undefined> {
return layout$.pipe(
switchMap((layout) =>
"grid" in layout && layout.grid.length > 0
? combineLatest(layout.grid.map((tile) => tile.media$))
: NEVER,
),
map((media) =>
media.find(
(m): m is UserMediaViewModel => m.id === id && m.type === "user",
),
),
);
}
function spotlightMedia$(
layout$: Observable<Layout>,
id: string,
): Observable<MediaViewModel | undefined> {
return layout$.pipe(
switchMap((layout) =>
layout.type === "spotlight-landscape"
? layout.spotlight.vm.media$
: NEVER,
),
map((media) => media.find((m) => m.id === id)),
);
}
});
+28 -52
View File
@@ -82,7 +82,6 @@ import {
import { type BackgroundEffectsState } from "../BackgroundEffects";
import { shallowEquals as arrayShallowEquals } from "../../utils/array";
import { type MediaDevices } from "../MediaDevices";
import { type LowBandwidthMode } from "../LowBandwidthMode";
import { type MuteStates } from "../MuteStates";
import {
followDevice,
@@ -208,8 +207,6 @@ export interface CallViewModelProps {
client: Pick<MatrixClient, "getUserId" | "getDeviceId">;
mediaDevices: MediaDevices;
muteStates: MuteStates;
/** The call's low bandwidth mode, which outlives this view model. */
lowBandwidthMode: LowBandwidthMode;
encryptionSystem: EncryptionSystem;
/**
* The size of the space the call is drawn in: the page when Element Call
@@ -509,7 +506,6 @@ export function createCallViewModel$(
client,
mediaDevices,
muteStates,
lowBandwidthMode,
encryptionSystem,
viewSize$,
handsRaisedSubject$,
@@ -657,10 +653,6 @@ export function createCallViewModel$(
});
});
lowBandwidthMode.enabled$
.pipe(scope.bind())
.subscribe((enabled) => rtcParticipation.setReceiveVideo(!enabled));
const members$ = scope.behavior<(LocalRTCMember | RemoteRTCMember)[]>(
combineLatest(
[rtcParticipation.localMember$, rtcParticipation.remoteMembers$],
@@ -758,7 +750,6 @@ export function createCallViewModel$(
),
mediaDevices,
pretendToBeDisconnected$: reconnecting$,
videoPaused$: lowBandwidthMode.enabled$,
displayName$: member.displayName$,
mxcAvatarUrl$: member.avatarUrl$,
handRaised$: scope.behavior(
@@ -934,6 +925,34 @@ export function createCallViewModel$(
),
);
const spotlightAndPip$ = scope.behavior(
combineLatest(
[ringingMedia$, screenShares$, spotlightSpeaker$, localUserMediaForPip$],
(ringing, screenShares, speaker, localPip) =>
computeSpotlight({ ringing, screenShares, speaker, localPip }),
).pipe(
distinctUntilChanged(
(a, b) =>
arrayShallowEquals(a.spotlight, b.spotlight) && a.pip === b.pip,
),
),
);
const spotlight$ = scope.behavior<MediaViewModel[]>(
spotlightAndPip$.pipe(
map(({ spotlight }) => spotlight),
distinctUntilChanged<MediaViewModel[]>(arrayShallowEquals),
),
);
const hasRemoteScreenShares$ = scope.behavior<boolean>(
spotlight$.pipe(
map((spotlight) =>
spotlight.some((vm) => vm.type === "screen share" && !vm.local),
),
),
);
const pipEnabled$ = scope.behavior(setPipEnabled$, false);
// A guess at what the window's mode should be based on the size and shape of
@@ -961,49 +980,6 @@ export function createCallViewModel$(
),
);
// A share received without its picture is a blank tile: one is no use
// in a window this small
const spotlightScreenShares$ = scope.behavior(
combineLatest(
[screenShares$, lowBandwidthMode.enabled$, windowMode$],
(screenShares, lowBandwidth, windowMode) =>
lowBandwidth && windowMode === "pip" ? [] : screenShares,
),
);
const spotlightAndPip$ = scope.behavior(
combineLatest(
[
ringingMedia$,
spotlightScreenShares$,
spotlightSpeaker$,
localUserMediaForPip$,
],
(ringing, screenShares, speaker, localPip) =>
computeSpotlight({ ringing, screenShares, speaker, localPip }),
).pipe(
distinctUntilChanged(
(a, b) =>
arrayShallowEquals(a.spotlight, b.spotlight) && a.pip === b.pip,
),
),
);
const spotlight$ = scope.behavior<MediaViewModel[]>(
spotlightAndPip$.pipe(
map(({ spotlight }) => spotlight),
distinctUntilChanged<MediaViewModel[]>(arrayShallowEquals),
),
);
const hasRemoteScreenShares$ = scope.behavior<boolean>(
spotlight$.pipe(
map((spotlight) =>
spotlight.some((vm) => vm.type === "screen share" && !vm.local),
),
),
);
const spotlightExpandedToggle$ = new Subject<void>();
const spotlightExpanded$ = createToggle$(
scope,
@@ -6,10 +6,6 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
Please see LICENSE in the repository root for full details.
*/
import {
createLowBandwidthMode,
type LowBandwidthMode,
} from "../LowBandwidthMode";
import {
type Behavior,
constant,
@@ -99,7 +95,6 @@ export interface CallViewModelInputs {
mediaDevices: MediaDevices;
initialSyncState: SyncState;
viewSize$: Behavior<{ width: number; height: number }>;
lowBandwidthMode: LowBandwidthMode;
}
export const localParticipant: Participant = { identity: "" };
@@ -126,7 +121,6 @@ export function withCallViewModel(mode: MatrixRTCMode) {
mediaDevices = mockMediaDevices({}),
initialSyncState = SyncState.Syncing,
viewSize$ = constant({ width: 1000, height: 800 }),
lowBandwidthMode = createLowBandwidthMode(),
}: Partial<CallViewModelInputs> = {},
continuation: (
vm: CallViewModel,
@@ -296,7 +290,6 @@ export function withCallViewModel(mode: MatrixRTCMode) {
client: room.client,
mediaDevices,
muteStates,
lowBandwidthMode,
encryptionSystem: { kind: E2eeType.PER_PARTICIPANT },
viewSize$,
handsRaisedSubject$: raisedHands$,
-25
View File
@@ -1,25 +0,0 @@
/*
Copyright 2026 Element Creations Ltd.
SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
Please see LICENSE in the repository root for full details.
*/
import { describe, test } from "vitest";
import { withTestScheduler } from "../utils/test";
import { createLowBandwidthMode } from "./LowBandwidthMode";
describe("LowBandwidthMode", () => {
test("starts off, and is turned on and off and reset without developer mode", () => {
withTestScheduler(({ schedule, expectObservable }) => {
const mode = createLowBandwidthMode();
schedule("-ab-ar", {
a: () => mode.setEnabled(true),
b: () => mode.setEnabled(false),
r: () => mode.reset(),
});
expectObservable(mode.enabled$).toBe("nyn-yn", { y: true, n: false });
});
});
});
-31
View File
@@ -1,31 +0,0 @@
/*
Copyright 2026 Element Creations Ltd.
SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
Please see LICENSE in the repository root for full details.
*/
import { BehaviorSubject } from "rxjs";
import { type Behavior } from "./Behavior";
/**
* Whether the call has given up video to keep audio flowing on a slow
* network. Lasts for one call: never stored.
*/
export interface LowBandwidthMode {
enabled$: Behavior<boolean>;
/** The one way in and out. Not gated on developer mode: only the switch is. */
setEnabled(enabled: boolean): void;
/** Back to off, for a new call. */
reset(): void;
}
export function createLowBandwidthMode(): LowBandwidthMode {
const enabled$ = new BehaviorSubject(false);
return {
enabled$,
setEnabled: (enabled): void => enabled$.next(enabled),
reset: (): void => enabled$.next(false),
};
}
+3 -17
View File
@@ -11,7 +11,7 @@ import {
type ObservableScope,
trackBySource$,
} from "@element-hq/matrixrtc-sdk";
import { combineLatest, map } from "rxjs";
import { map } from "rxjs";
import {
type BaseScreenShareInputs,
@@ -27,11 +27,6 @@ export interface RemoteScreenShareViewModel
* Whether this screen share's video should be displayed.
*/
videoEnabled$: Behavior<boolean>;
/**
* Whether the call has stopped receiving video: the share is shown
* without its picture, and nothing in its place.
*/
videoPaused$: Behavior<boolean>;
/**
* Whether this screen share should be considered to have an audio track.
*/
@@ -40,16 +35,11 @@ export interface RemoteScreenShareViewModel
export interface RemoteScreenShareInputs extends BaseScreenShareInputs {
pretendToBeDisconnected$: Behavior<boolean>;
videoPaused$: Behavior<boolean>;
}
export function createRemoteScreenShare(
scope: ObservableScope,
{
pretendToBeDisconnected$,
videoPaused$,
...inputs
}: RemoteScreenShareInputs,
{ pretendToBeDisconnected$, ...inputs }: RemoteScreenShareInputs,
): RemoteScreenShareViewModel {
const audio$ = trackBySource$(
scope,
@@ -68,12 +58,8 @@ export function createRemoteScreenShare(
}),
local: false,
videoEnabled$: scope.behavior(
combineLatest(
[pretendToBeDisconnected$, videoPaused$],
(disconnected, paused) => !disconnected && !paused,
),
pretendToBeDisconnected$.pipe(map((disconnected) => !disconnected)),
),
videoPaused$,
audioEnabled$: scope.behavior(
audio$.pipe(map((track) => track !== undefined)),
),
+4 -6
View File
@@ -33,13 +33,11 @@ export interface RemoteUserMediaViewModel
export interface RemoteUserMediaInputs extends BaseUserMediaInputs {
pretendToBeDisconnected$: Behavior<boolean>;
/** Whether the call has stopped receiving video, while the sender may still be sending it. */
videoPaused$: Behavior<boolean>;
}
export function createRemoteUserMedia(
scope: ObservableScope,
{ pretendToBeDisconnected$, videoPaused$, ...inputs }: RemoteUserMediaInputs,
{ pretendToBeDisconnected$, ...inputs }: RemoteUserMediaInputs,
): RemoteUserMediaViewModel {
const baseUserMedia = createBaseUserMedia(scope, inputs);
@@ -75,9 +73,9 @@ export function createRemoteUserMedia(
),
),
videoEnabled$: scope.behavior(
combineLatest([pretendToBeDisconnected$, videoPaused$]).pipe(
switchMap(([disconnected, paused]) =>
disconnected || paused ? of(false) : baseUserMedia.videoEnabled$,
pretendToBeDisconnected$.pipe(
switchMap((disconnected) =>
disconnected ? of(false) : baseUserMedia.videoEnabled$,
),
),
),
@@ -90,7 +90,6 @@ export function createWrappedUserMedia(
member,
mediaDevices,
pretendToBeDisconnected$,
videoPaused$,
...inputs
}: WrappedUserMediaInputs,
): WrappedUserMediaViewModel {
@@ -99,7 +98,6 @@ export function createWrappedUserMedia(
: createRemoteUserMedia(scope, {
member,
pretendToBeDisconnected$,
videoPaused$,
...inputs,
});
@@ -124,7 +122,6 @@ export function createWrappedUserMedia(
id,
member,
pretendToBeDisconnected$,
videoPaused$,
});
},
),
-21
View File
@@ -46,27 +46,6 @@ describe("MediaView", () => {
});
});
describe("with no placeholder", () => {
it("draws nothing in place of a video that is off", () => {
render(
<MediaView
{...baseProps}
video={mockVideoTrack({ source: "screenShare" })}
videoEnabled={false}
placeholder="none"
/>,
);
expect(
screen.queryByRole("img", { name: "@alice:example.com" }),
).toBeNull();
expect(screen.getByTestId("videoTile")).toHaveAttribute(
"data-video-enabled",
"false",
);
expect(screen.getByTestId("name_tag")).toHaveTextContent("some name");
});
});
describe("with video", () => {
it("labels the video element with the track source", () => {
render(
+9 -14
View File
@@ -58,8 +58,6 @@ interface Props extends ComponentProps<typeof animated.div> {
displayName: string;
mxcAvatarUrl: string | undefined;
avatarStyle?: "solid" | "translucent";
/** What is drawn while there is no video: the avatar, or nothing. */
placeholder?: "avatar" | "none";
background?: "solid" | "transparent";
focusable: boolean;
primaryButton?: ReactNode;
@@ -99,7 +97,6 @@ export const MediaView: FC<Props> = ({
displayName,
mxcAvatarUrl,
avatarStyle = "solid",
placeholder = "avatar",
background = "solid",
focusable,
primaryButton,
@@ -191,17 +188,15 @@ export const MediaView: FC<Props> = ({
<div className={styles.speakingBorder} />
</div>
)}
{placeholder === "avatar" && (
<Avatar
id={userId}
name={displayName}
size={avatarSize}
src={mxcAvatarUrl}
data-style={avatarStyle}
className={styles.avatar}
style={{ display: video && videoEnabled ? "none" : "initial" }}
/>
)}
<Avatar
id={userId}
name={displayName}
size={avatarSize}
src={mxcAvatarUrl}
data-style={avatarStyle}
className={styles.avatar}
style={{ display: video && videoEnabled ? "none" : "initial" }}
/>
{video !== undefined && (
// A live camera has no captions to offer
// eslint-disable-next-line jsx-a11y/media-has-caption
+1 -8
View File
@@ -146,7 +146,6 @@ SpotlightUserMediaItem.displayName = "SpotlightUserMediaItem";
interface SpotlightScreenShareItemProps extends SpotlightMemberMediaItemBaseProps {
vm: ScreenShareViewModel;
videoEnabled: boolean;
placeholder?: "avatar" | "none";
}
const SpotlightScreenShareItem: FC<SpotlightScreenShareItemProps> = ({
@@ -164,14 +163,8 @@ const SpotlightRemoteScreenShareItem: FC<
SpotlightRemoteScreenShareItemProps
> = ({ vm, ...props }) => {
const videoEnabled = useBehavior(vm.videoEnabled$);
const videoPaused = useBehavior(vm.videoPaused$);
return (
<SpotlightScreenShareItem
vm={vm}
videoEnabled={videoEnabled}
placeholder={videoPaused ? "none" : "avatar"}
{...props}
/>
<SpotlightScreenShareItem vm={vm} videoEnabled={videoEnabled} {...props} />
);
};
+1 -8
View File
@@ -5,7 +5,6 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
Please see LICENSE in the repository root for full details.
*/
import { createLowBandwidthMode } from "../state/LowBandwidthMode";
import { type CallMembership } from "matrix-js-sdk/lib/matrixrtc";
import { BehaviorSubject } from "rxjs";
import { vitest } from "vitest";
@@ -222,7 +221,6 @@ export function getBasicCallViewModelEnvironment(
),
),
});
const lowBandwidthMode = createLowBandwidthMode();
const vm = createCallViewModel$(
scope,
{
@@ -231,7 +229,6 @@ export function getBasicCallViewModelEnvironment(
client,
mediaDevices,
muteStates,
lowBandwidthMode,
encryptionSystem: { kind: E2eeType.PER_PARTICIPANT },
viewSize$: constant({ width: 1000, height: 800 }),
handsRaisedSubject$: handRaisedSubject$,
@@ -257,11 +254,7 @@ export function getBasicCallViewModelEnvironment(
return {
vm,
footerVm,
developerSettingsVm: createDeveloperSettingsTabViewModel(
testScope(),
vm,
lowBandwidthMode,
),
developerSettingsVm: createDeveloperSettingsTabViewModel(testScope(), vm),
rtcMemberships$,
rtcSession,
matrixRoom,
+1 -10
View File
@@ -406,12 +406,7 @@ export function mockRemoteMedia(
roomMember: Partial<RoomMember>,
/** The tracks, or a behavior of them for a test that has them arrive. */
tracks: MockTracks | Behavior<MockTracks>,
{
transport,
videoPaused$ = constant(false),
}: { transport?: Transport; videoPaused$?: Behavior<boolean> } = {
transport: exampleTransport,
},
{ transport }: { transport?: Transport } = { transport: exampleTransport },
): RemoteUserMediaViewModel {
const member = mockMatrixRoomMember(rtcMember, roomMember);
return createRemoteUserMedia(testScope(), {
@@ -427,7 +422,6 @@ export function mockRemoteMedia(
encryptionSystem: { kind: E2eeType.PER_PARTICIPANT },
transport$: constant(transport),
pretendToBeDisconnected$: constant(false),
videoPaused$,
displayName$: constant(member.rawDisplayName ?? "nodisplayname"),
mxcAvatarUrl$: constant(member.getMxcAvatarUrl()),
handRaised$: constant(null),
@@ -439,7 +433,6 @@ export function mockRemoteScreenShare(
rtcMember: CallMembership,
roomMember: Partial<RoomMember>,
tracks: MockTracks,
videoPaused$: Behavior<boolean> = constant(false),
): RemoteScreenShareViewModel {
const member = mockMatrixRoomMember(rtcMember, roomMember);
return createRemoteScreenShare(testScope(), {
@@ -453,7 +446,6 @@ export function mockRemoteScreenShare(
encryptionSystem: { kind: E2eeType.PER_PARTICIPANT },
transport$: constant(exampleTransport),
pretendToBeDisconnected$: constant(false),
videoPaused$,
displayName$: constant(member.rawDisplayName ?? "nodisplayname"),
mxcAvatarUrl$: constant(member.getMxcAvatarUrl()),
});
@@ -582,7 +574,6 @@ function mockSlotWithParticipation(
keyRotationSuppressed$,
connectedTransports$,
setAudioOutputDeviceId: vi.fn(async () => Promise.resolve()),
setReceiveVideo: vi.fn(),
sendData: vi.fn(async () => Promise.resolve()),
data$: NEVER,
};
-50
View File
@@ -75,53 +75,3 @@ for (const [property, value] of [
get: () => value,
configurable: true,
});
const storage: Record<string, string> = {};
const localStoragePolyfill = {
getItem(key: string) {
return Object.prototype.hasOwnProperty.call(storage, key)
? storage[key]
: null;
},
setItem(key: string, value: string) {
storage[key] = String(value);
},
removeItem(key: string) {
delete storage[key];
},
clear() {
for (const key in storage) {
delete storage[key];
}
},
key(index: number) {
const keys = Object.keys(storage);
return keys[index] ?? null;
},
get length() {
return Object.keys(storage).length;
},
} as unknown as Storage;
if (
typeof globalThis.localStorage === "undefined" ||
typeof globalThis.localStorage.clear !== "function"
) {
Object.defineProperty(globalThis, "localStorage", {
value: localStoragePolyfill,
writable: true,
configurable: true,
});
}
if (
typeof window !== "undefined" &&
(typeof window.localStorage === "undefined" ||
typeof window.localStorage.clear !== "function")
) {
Object.defineProperty(window, "localStorage", {
value: localStoragePolyfill,
writable: true,
configurable: true,
});
}
+4
View File
@@ -21,6 +21,10 @@ export default defineConfig((configEnv) =>
css: { include: /.+/ },
setupFiles: ["src/vitest.setup.ts"],
environment: "jsdom",
// Node's own localStorage (on by default since Node 25) is
// unusable without a file to back it and shadows jsdom's.
// We should be able to remove this once we switch to Vitest 5.
execArgv: ["--no-experimental-webstorage"],
include: [
"src/**/*.test.ts",
"src/**/*.test.tsx",