Files
corescope-rx/src
efitenandClaude Opus 5 0e72292253 fix: "Push pending now" during a slow connect left orphaned MQTT sockets (v1.18.4)
Publisher.reconnect() called mqtt.js client.reconnect() unconditionally.
mqtt.js connect() replaces this.stream without closing the previous one
(client.js:257), so a press while a CONNECT was still unanswered left the
earlier socket open. When an orphan closed, its 'close' set
client.connected = false over a live session and armed a reconnect that
orphaned that session in turn.

Field log 2026-09-19: connack timeouts on a weak mobile link, then five
presses in four seconds (12:05:54 to 12:05:57), then "connected" followed
by "offline" and "connection closed" in the same second at 12:05:58,
12:06:00, 12:06:02 and 12:06:04.

reconnect() now returns false and does nothing while an attempt is in
flight (no session, no reconnect timer armed); the Push button logs that.
Once the socket has closed it still skips the 4 s wait. Two tests run the
real mqtt.js client over a fake stream; without the guard the first fails.

Not verified: the EMQX log has no lines for this client id, so the
broker-side session takeover between the sockets was not observed.

Version, release notes and the service-worker cache bump ride along, as
AGENTS.md requires.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-19 19:54:05 +02:00
..