Skip to content

wireClient: unbounded offline queue, no invoke timeout, reconnect stampede #130

Closed

Description

@currentbits

Problem

src/wireClient.ts:100-115: while disconnected, every invoke() is pushed into queued with no size limit, and flushQueue() (wireClient.ts:84-87) fires the whole backlog at once on reconnect. Inflight calls are only settled by a matching reply (wireClient.ts:145-161); there is no timeout, so a handler that hangs in main leaves the renderer promise pending forever (button stuck busy).

Impact

The renderer has many interval pollers (devServerStatus every 3-5s, refreshStatus every 60s, summaries every 2s). During a web-server outage these pile into queued unboundedly, and on reconnect they all hit the main process simultaneously: a self-inflicted thundering herd on top of the memory growth.

Fix direction

  • Cap the offline queue (drop oldest, or coalesce repeat poller calls).
  • Add a per-invoke timeout that rejects and surfaces an error.
  • Stagger or dedupe queue flush on reconnect.

Activity

  1. added
    bug
    plan:todo
    plan:doing
    and removed
    plan:todo
    on Aug 16, 2026
  2. added
    plan:done
    and removed
    plan:doing
    on Sep 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugplan:done

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions