feat(reconnect): visible reconnect indicator with backoff and soft-refresh #62
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/reconnect-ui"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
"Connection lost. Reconnecting..." on drop, escalates to red after 5min, briefly
green-flashes "Connected" on recovery.
htmx-ext-ws default (uncapped full-jitter, exceeds 17min after ~10 retries).
<!-- ping -->text-frame heartbeat (replaces the oldprotocol-level Ping which was invisible to JS); client resets a 60s watchdog on every
htmx:wsAfterMessage.lc-ws-reconnecthtmx extension exposeswrapper.init()so the watchdog canforce a reconnect for close codes the extension would otherwise ignore (1006/1012/1013 are
auto-handled; everything else - clean closes, our own 4000 from the watchdog - now
reconnects via this path).
htmx.ajax(GET pathname, select '#main'). The smoke directive in the plan asks the reviewer to verify whether this isload-bearing vs. the per-page subscribe re-fire being sufficient; if the latter, drop the
soft-refresh in a follow-up commit.
Architectural decisions
extension-internal API; replacing would have meant reimplementing the swap loop. Per-room
subscribeframes already attach tohtmx:wsOpenand re-fire automatically on reconnectfor free.
transparently and give JS no signal. Single mechanism keeps NAT alive AND drives the
client watchdog.
select: '#main'for soft-refresh. Verified in vendored htmx; extracts just the<main>from the full-page response, avoiding nested-layout issues.Test plan
Automated:
just check,just test,just test-saas,just verifyall pass.Manual smoke (run from a browser; see plan section "Final verification" for the full
list):
on recovery
manual refresh
commented out), do users see messages sent during the disconnect window? If no,
soft-refresh stays. If yes (or the gap is acceptable), follow-up commit drops the
htmx.ajaxcall.