[client] stream_measurements: survive the 2h session expiry (re-auth before WS re-handshake) #158
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
The
cwt_sessioncookie lives login + 2 h (thex-cwt-tokenheader ofPOST /api/v1/authent, see docs/energy.comwatt.com/auth.md), and the samecookie authenticates the
wss://frontage.energy.comwatt.com/wshandshake.A
stream_measurementssubscription can therefore outlive the session:the server cuts the socket at expiry, and the existing
reconnect=Truepath re-handshakes — with a cookie that may be dead.
_request? If yes, #99's reactiveauto_reauth/ opt-inproactive_reauthalready covers the re-handshake; if no, route it soit does, or re-auth explicitly before re-handshaking).
session_expires_at(from #99) to re-auth ahead of the2h boundary during long streams instead of eating the disconnect.
refreshtokenis not a session refresh (see #70 field notes) — donot chase that endpoint.
Related: #99 (x-cwt-token capture + proactive re-auth), #101 (ping/stop
frames — orthogonal but same long-lived-stream robustness theme).