✨ feat: proactive re-auth before WS handshakes #161
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/ws-proactive-reauth"
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
The WebSocket handshake was the only client path not going through
_request, so the proactive half ofauto_reauth(#160) never applied to it. One line in_connect_and_startfixes both entry points: a stream no longer starts with a nearly-dead cookie, and after a drop the reconnect handshake presents a fresh cookie instead of eating a 401 → re-login → retry. The reactive 401-at-handshake path is kept as the fallback (early revocation, unknown expiry, clock skew).Live-context from today's probes:
POST /v1/logoutdoes NOT invalidate the session server-side (the old cookie keeps working), so expiry is presumably only enforced where the cookie is presented — REST requests and WS handshakes. A 2 h live probe is currently running to confirm whether an established stream survives the real expiry instant; either outcome keeps this slice correct (it covers every path where the cookie is actually presented).Evidence
auto_reauth=False); existing reactive-handshake tests pass unchanged;pytest= 202 passed;mypyclean.Merge Danger
Door: two-way — one line plus tests; revert restores reactive-only handshakes.
Blast Radius: low —
stream_measurementsonly; withauto_reauth(default) an expired-at-start stream now costs one login POST instead of a 401 round trip.Closes #158 (handshake half; the established-stream-through-expiry observation lands in the field notes once the running 2 h probe completes)
WIP: ✨ feat: proactive re-auth before WS handshakesto ✨ feat: proactive re-auth before WS handshakes