Files
corescope-rx/test
efitenandClaude Opus 4.8 bccedfbb84 fix: MQTT connection wedged after one drop, leaving all receptions pending (v1.3.2)
Field report: CoreScope showed disconnected and every reception stayed pending,
starting with today's v1.3.x update. Broker is healthy (auth/ACL/listener all OK),
so the regression is client-side.

Root cause: today's diff lowered MQTT keepalive 60→20 s, which exercises the
reconnect path far more often — and the pre-existing `client.once('error', reject)`
left NO error listener after the first error. mqtt.js is an EventEmitter, so a later
'error' (during a transient reconnect) throws unhandled and wedges the auto-reconnect
loop: the client never reconnects, drain never runs, the queue grows unbounded.

- Revert keepalive to the mqtt.js default (restores v1.2.0 connection behaviour).
- Attach a PERSISTENT 'error' listener; the initial-connect promise removes its own
  listeners once settled so a later error is always handled, never thrown.
- Log every broker transition (connect/reconnect/offline/close/error + reason) to the
  debug log — these were previously invisible, so the drop couldn't be diagnosed.
- "Push pending now" forces a reconnect when the link is down (manual recovery).
- Home upload dot turns red (not idle-grey) on a real disconnect.

SW cache v9→v10.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-20 18:57:52 +02:00
..