📝 docs: WS session-expiry probe findings (handshake 401, established-stream open) #189

Merged
mat merged 1 commit from docs/ws-expiry-probe into main 2026-10-27 13:49:24 +00:00
Owner

Summary

 docs/energy.comwatt.com/websocket-realtime.md
+  ### Session expiry and the stream
+    handshake with expired cookie → HTTP 401 (like REST) — expiry enforced
+    at every cookie-presentation point
+    established stream through the expiry instant: UNOBSERVED (host suspended)
+    → rerun pending with sleep inhibited

The 2 h live probe launched after #161 (to settle "does an established stream survive the session expiry?") returned partial results: the observation host suspended across the boundary, but the post-expiry checks (73 min after expiry) are solid: the old cookie is rejected with 401 at the WS handshake, exactly like REST — confirming expiry is enforced everywhere the cookie is presented, and validating a posteriori the layered re-auth design of stream_measurements (proactive pre-handshake refresh + reactive 401 fallback). The established-stream-at-expiry question stays open; an inhibited rerun is in flight and will follow as its own update.

Evidence

  • Before: the WS doc had no session-expiry section; the handshake-rejects-expired-cookies claim was an inference.
  • After: dated live findings (2026-10-27) recorded: x-cwt-token = login + 2 h to the second, handshake 401, REST 401s, stream healthy to ~5.5 min pre-expiry (2236 frames, ~98–99/300 s), boundary crossing unobserved with the rerun noted as pending. Docs-only — pytest = 242 passed, mypy clean.

Merge Danger

Door: two-way — documentation only.

Blast Radius: none — no code change.

## Summary ```diff docs/energy.comwatt.com/websocket-realtime.md + ### Session expiry and the stream + handshake with expired cookie → HTTP 401 (like REST) — expiry enforced + at every cookie-presentation point + established stream through the expiry instant: UNOBSERVED (host suspended) + → rerun pending with sleep inhibited ``` The 2 h live probe launched after #161 (to settle "does an established stream survive the session expiry?") returned partial results: the observation host suspended across the boundary, but the post-expiry checks (73 min after expiry) are solid: the old cookie is rejected with **401 at the WS handshake**, exactly like REST — confirming expiry is enforced everywhere the cookie is presented, and validating a posteriori the layered re-auth design of `stream_measurements` (proactive pre-handshake refresh + reactive 401 fallback). The established-stream-at-expiry question stays open; an inhibited rerun is in flight and will follow as its own update. ## Evidence - **Before:** the WS doc had no session-expiry section; the handshake-rejects-expired-cookies claim was an inference. - **After:** dated live findings (2026-10-27) recorded: x-cwt-token = login + 2 h to the second, handshake 401, REST 401s, stream healthy to ~5.5 min pre-expiry (2236 frames, ~98–99/300 s), boundary crossing unobserved with the rerun noted as pending. Docs-only — `pytest` = 242 passed, `mypy` clean. ## Merge Danger **Door:** two-way — documentation only. **Blast Radius:** none — no code change.
📝 docs: WS session-expiry probe findings (handshake 401, established-stream open)
All checks were successful
Tests / forgejo-pytest (push) Successful in 44s
Tests / forgejo-pytest (pull_request) Successful in 43s
1935ef21f3
mat changed title from WIP: 📝 docs: WS session-expiry probe findings (handshake 401, established-stream open) to 📝 docs: WS session-expiry probe findings (handshake 401, established-stream open) 2026-10-27 13:49:19 +00:00
mat merged commit fad6097ea3 into main 2026-10-27 13:49:24 +00:00
mat deleted branch docs/ws-expiry-probe 2026-10-27 13:49:24 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
mat/python-comwatt-client!189
No description provided.