lotusCallState=1 in standalone (non-widget) mode builds the whole pipeline for nothing #31

Closed
opened 2026-09-12 02:13:14 -04:00 by jared · 1 comment
Owner

Severity: low · Type: performance · Confidence: high

Location: src/lotus/lotusCallState.ts:34-70, src/lotus/lotusWidget.ts:56-64

Problem

startLotusCallState gates only on the URL flag, not on widget !== null. Opened standalone with ?lotusCallState=1 (a link a user can be handed, or a leftover param), EC builds the per-member combineLatest graph and runs JSON.stringify over the participant array at up to 8 Hz, then lotusSendToHost returns false immediately because widget?.api is undefined — every byte of that work is discarded. The other lotus features correctly short-circuit on widget first (lotusFocus.ts:24, lotusDecorations.ts:63).

How to trigger

load the EC bundle directly with ?lotusCallState=1 and no widgetId/parentUrl.

Suggested fix

add if (!widget) return () => undefined; at the top of startLotusCallState, mirroring the other modules.


Filed from the September 2026 audit (branch lotus).

**Severity:** low · **Type:** performance · **Confidence:** high **Location:** `src/lotus/lotusCallState.ts:34-70`, `src/lotus/lotusWidget.ts:56-64` ### Problem `startLotusCallState` gates only on the URL flag, not on `widget !== null`. Opened standalone with `?lotusCallState=1` (a link a user can be handed, or a leftover param), EC builds the per-member `combineLatest` graph and runs `JSON.stringify` over the participant array at up to 8 Hz, then `lotusSendToHost` returns `false` immediately because `widget?.api` is undefined — every byte of that work is discarded. The other lotus features correctly short-circuit on `widget` first (`lotusFocus.ts:24`, `lotusDecorations.ts:63`). ### How to trigger load the EC bundle directly with `?lotusCallState=1` and no `widgetId`/`parentUrl`. ### Suggested fix add `if (!widget) return () => undefined;` at the top of `startLotusCallState`, mirroring the other modules. --- _Filed from the September 2026 audit (branch `lotus`)._
jared added this to the EC fork audit 2026-09 · Medium & Low milestone 2026-09-12 02:13:14 -04:00
jared added the bugpriority: lowperformancearea: widget-actions labels 2026-09-12 02:13:14 -04:00
jared self-assigned this 2026-09-12 02:13:14 -04:00
jared closed this issue 2026-09-12 11:56:46 -04:00
Author
Owner

Fixed in fd957bad, shipped in 0.25.0-lotus.1 (published by CI from tag v0.25.0-lotus.1) and consumed by cinny at 9a85a487.

Fixed in fd957bad, shipped in `0.25.0-lotus.1` (published by CI from tag v0.25.0-lotus.1) and consumed by cinny at 9a85a487.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: LotusGuild/element-call#31