Close invalid sessions SSE streams at heartbeat recheck #189

Merged
weichen merged 1 commits from fix/sse-session-invalidation into main 2026-10-13 04:35:26 +00:00
Owner

Why: Login recovery contract section 6.7 (Dev docs/svc-deploy/2026-10-13-login-recovery-contract.md) — established SSE connections must stop receiving private events once a password write destroys their session.

Evidence: go test ./... green including TestSSESessionInvalidationClosesStream over a real HTTP server (SELF worktree run); CI on this HEAD is the GATE.

Impact: Session-authenticated streams revalidate every 15s (test-shortened var) and terminate with a session-expired marker; API-key streams unchanged; reconnects rejected by middleware.

Refs: Dev PR #504.

Why: Login recovery contract section 6.7 (Dev docs/svc-deploy/2026-10-13-login-recovery-contract.md) — established SSE connections must stop receiving private events once a password write destroys their session. Evidence: go test ./... green including TestSSESessionInvalidationClosesStream over a real HTTP server (SELF worktree run); CI on this HEAD is the GATE. Impact: Session-authenticated streams revalidate every 15s (test-shortened var) and terminate with a session-expired marker; API-key streams unchanged; reconnects rejected by middleware. Refs: Dev PR #504.
weichen added 1 commit 2026-10-13 04:33:44 +00:00
Close invalid sessions' SSE streams at heartbeat recheck
ci / vet-and-test (pull_request) Successful in 55s
8b73afeef6
Why: The 2026-10-13 login recovery contract (Dev docs/svc-deploy/
2026-10-13-login-recovery-contract.md, plan item 6.7) requires that
established SSE connections stop receiving private events once a
password write destroys their session.

Evidence: go test ./... green; TestSSESessionInvalidationClosesStream
streams over a real HTTP server, invalidates the session via
AdminResetUserPassword, and asserts the stream terminates with the
session-expired marker within the recheck window (SELF, worktree run).

Impact: Session-authenticated event streams revalidate at a 15s
heartbeat cadence (package var, shortened in tests) and terminate on
invalidation; API-key streams are unchanged (key revocation is separate).
EventSource reconnects are rejected by the auth middleware.

Refs: Dev PR #504; login recovery contract section 6.7.
weichen merged commit 349a47de6f into main 2026-10-13 04:35:26 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: weichen/Agent-System-Backend#189