Torn-down lotus actions pile up in the LazyEventEmitter backlog and replay stale #18

Closed
opened 2026-09-12 02:13:06 -04:00 by jared · 0 comments
Owner

Severity: medium · Type: bug · Confidence: medium

Location: src/LazyEventEmitter.ts:20-50, src/widget.ts:108-113, src/lotus/lotusFocus.ts:41, src/lotus/lotusDecorations.ts:88

Problem

widget.ts calls ev.preventDefault() for every lotus action and forwards it to lazyActions. When a handler has been removed (any of the start* teardowns), super.emit returns false and the request is appended to eventBacklogs forever — never replied to, so the host's transport.send pends to its 10 s timeout, and the map grows without bound for the lifetime of the page. On the next registration the whole backlog replays synchronously: each handler calls w.api.transport.reply(ev.detail, {}) for long-expired request ids (the host logs "response to unknown request" for each), and for focus_participant every queued pin is applied in sequence so the oldest intent can end up overwritten by whatever arrived last, silently. Nothing ever prunes the backlog.

How to trigger

unmount the call view (handlers off), send several io.lotus.focus_participant/io.lotus.decorations from the host, then remount.

Suggested fix

give the lotus actions a non-lazy path — in widget.ts, if lazyActions.emit returns false for a lotus action, reply (or error-reply) immediately instead of backlogging; optionally cap/expire the backlog per action type.


Filed from the September 2026 audit (branch lotus).

**Severity:** medium · **Type:** bug · **Confidence:** medium **Location:** `src/LazyEventEmitter.ts:20-50`, `src/widget.ts:108-113`, `src/lotus/lotusFocus.ts:41`, `src/lotus/lotusDecorations.ts:88` ### Problem `widget.ts` calls `ev.preventDefault()` for every lotus action and forwards it to `lazyActions`. When a handler has been removed (any of the `start*` teardowns), `super.emit` returns false and the request is appended to `eventBacklogs` forever — never replied to, so the host's `transport.send` pends to its 10 s timeout, and the map grows without bound for the lifetime of the page. On the next registration the whole backlog replays synchronously: each handler calls `w.api.transport.reply(ev.detail, {})` for long-expired request ids (the host logs "response to unknown request" for each), and for `focus_participant` every queued pin is applied in sequence so the *oldest* intent can end up overwritten by whatever arrived last, silently. Nothing ever prunes the backlog. ### How to trigger unmount the call view (handlers off), send several `io.lotus.focus_participant`/`io.lotus.decorations` from the host, then remount. ### Suggested fix give the lotus actions a non-lazy path — in `widget.ts`, if `lazyActions.emit` returns false for a lotus action, reply (or error-reply) immediately instead of backlogging; optionally cap/expire the backlog per action type. --- _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:06 -04:00
jared added the bugpriority: mediumarea: widget-actions labels 2026-09-12 02:13:06 -04:00
jared self-assigned this 2026-09-12 02:13:06 -04:00
jared closed this issue 2026-09-13 01:22:54 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
2026-11-14
Dependencies

No dependencies set.

Reference: LotusGuild/element-call#18