After a homeserver stall the frame shows "Connection lost · Reconnect"
while the host kept showing the call as joined, with controls that did
nothing. While the error page is up, report io.lotus.call_error
{ code, recoverable } (and { code: null } when it clears), and accept
io.lotus.reconnect to run the page's own Reconnect / Try again.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017PCb59uY3UKqDqt7B6hzd5
63 lines
2.4 KiB
TypeScript
63 lines
2.4 KiB
TypeScript
/*
|
|
Copyright 2026 Lotus Guild
|
|
|
|
SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
|
|
Please see LICENSE in the repository root for full details.
|
|
*/
|
|
|
|
import { describe, expect, test } from "vitest";
|
|
|
|
import { LOTUS_TO_WIDGET_ACTIONS, LotusWidgetActions } from "./lotusActions";
|
|
|
|
describe("LotusWidgetActions", () => {
|
|
test("every action value is namespaced under io.lotus.*", () => {
|
|
for (const value of Object.values(LotusWidgetActions)) {
|
|
expect(value).toMatch(/^io\.lotus\./);
|
|
}
|
|
});
|
|
|
|
test("LOTUS_TO_WIDGET_ACTIONS contains exactly the toWidget actions", () => {
|
|
// CallState is the only fromWidget action (host <- widget); everything
|
|
// else is toWidget (host -> widget) and must be allow-listed so
|
|
// `initializeWidget` accepts it.
|
|
const expectedToWidget = [
|
|
LotusWidgetActions.FocusParticipant,
|
|
LotusWidgetActions.InjectAudio,
|
|
LotusWidgetActions.SetQuality,
|
|
LotusWidgetActions.Decorations,
|
|
LotusWidgetActions.SetDeafen,
|
|
LotusWidgetActions.SetAudioOutput,
|
|
LotusWidgetActions.SetLayout,
|
|
LotusWidgetActions.OpenSettings,
|
|
LotusWidgetActions.ToggleReactions,
|
|
LotusWidgetActions.SetScreenshare,
|
|
LotusWidgetActions.SetHotkeys,
|
|
LotusWidgetActions.SetFrameScreenshare,
|
|
LotusWidgetActions.PromptScreenshare,
|
|
LotusWidgetActions.Reconnect,
|
|
];
|
|
|
|
expect(new Set(LOTUS_TO_WIDGET_ACTIONS)).toEqual(new Set(expectedToWidget));
|
|
expect(LOTUS_TO_WIDGET_ACTIONS).toHaveLength(expectedToWidget.length);
|
|
});
|
|
|
|
test("LOTUS_TO_WIDGET_ACTIONS excludes the fromWidget actions", () => {
|
|
// CallState, RequestState and DenoiseState are all fromWidget (widget ->
|
|
// host) per their doc comments in lotusActions.ts, so none of them should
|
|
// ever be allow-listed as a toWidget action.
|
|
expect(LOTUS_TO_WIDGET_ACTIONS).not.toContain(LotusWidgetActions.CallState);
|
|
expect(LOTUS_TO_WIDGET_ACTIONS).not.toContain(
|
|
LotusWidgetActions.RequestState,
|
|
);
|
|
expect(LOTUS_TO_WIDGET_ACTIONS).not.toContain(
|
|
LotusWidgetActions.DenoiseState,
|
|
);
|
|
expect(LOTUS_TO_WIDGET_ACTIONS).not.toContain(
|
|
LotusWidgetActions.ControlsState,
|
|
);
|
|
expect(LOTUS_TO_WIDGET_ACTIONS).not.toContain(LotusWidgetActions.MicLevel);
|
|
expect(LOTUS_TO_WIDGET_ACTIONS).not.toContain(LotusWidgetActions.Hotkey);
|
|
expect(LOTUS_TO_WIDGET_ACTIONS).not.toContain(LotusWidgetActions.CallError);
|
|
});
|
|
});
|