fix(calls): one delayed-event restart in flight per id, with a timeout (#318) #381

Merged
jared merged 1 commits from fix/delayed-restart-dedupe into lotus 2026-10-17 22:37:02 -04:00
Owner

Refs #318. This is the host-side request pile-up; the "host still shows in call after Element Call reports Connection lost" half needs a fork change and stays open.

While Synapse is stalled, Element Call times out each update_delayed_event restart locally after 2 s and asks again. CallWidgetDriver.restartScheduledDelayedEvent opened a new HTTP request every time, with no timeout.

Change

  • One in-flight restart per delay_id. Callers asking again while it's pending get the same promise (new dedupeInFlight helper, unit-tested).
  • The host request now has its own 5 s localTimeoutMs, so stale requests are aborted instead of queued.

Verified in a call, with the local Synapse frozen (SIGSTOP) for 60 s:

  • Before: 12 restart requests opened; on recovery 404 ×5, 429 ×7 (our own burst).
  • After: 4 requests, one at a time; on recovery no burst.

tsc clean · unit tests pass · ESLint clean.

🤖 Generated with Claude Code

https://claude.ai/code/session_017PCb59uY3UKqDqt7B6hzd5

Refs #318. This is the host-side request pile-up; the "host still shows in call after Element Call reports Connection lost" half needs a fork change and stays open. While Synapse is stalled, Element Call times out each `update_delayed_event` restart locally after 2 s and asks again. `CallWidgetDriver.restartScheduledDelayedEvent` opened a new HTTP request every time, with no timeout. **Change** - One in-flight restart per `delay_id`. Callers asking again while it's pending get the same promise (new `dedupeInFlight` helper, unit-tested). - The host request now has its own 5 s `localTimeoutMs`, so stale requests are aborted instead of queued. **Verified** in a call, with the local Synapse frozen (`SIGSTOP`) for 60 s: - **Before:** 12 restart requests opened; on recovery **404 ×5, 429 ×7** (our own burst). - **After:** 4 requests, one at a time; on recovery **no burst**. `tsc` clean · unit tests pass · ESLint clean. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_017PCb59uY3UKqDqt7B6hzd5
jared added 1 commit 2026-10-17 19:35:10 -04:00
fix(calls): one delayed-event restart in flight per id, with a timeout (#318)
CI / Build & Quality Checks (pull_request) Successful in 3m12s
CI / Trigger Desktop Build (pull_request) Skipped
CI / Docker image build & smoke test (pull_request) Skipped
CI / Secret scan (gitleaks) (pull_request) Successful in 9s
CI / Playwright smoke (e2e) (pull_request) Successful in 15m31s
4ddcda122a
During a homeserver stall Element Call retries update_delayed_event every
2 s, and the host opened a new HTTP request each time: 12 pending in a
60 s stall, all landing together on recovery (404 x5, 429 x7). Share the
in-flight restart per delay id and abort it after 5 s.

Refs #318

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017PCb59uY3UKqDqt7B6hzd5
jared merged commit f9265d2d90 into lotus 2026-10-17 22:37:02 -04:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: LotusGuild/cinny#381