Story: Session lifecycle follow-up
Table of Contents
This page documents a story in Sprint 06. It captures the goal, current status, acceptance criteria, and the tasks that compose it.
Goal
Close out sprint 05's POSTPONED session cancellation, then complete the disconnect story: logout message, client heartbeat for disconnect detection, fix the two crash modes the original session work left behind.
Status
| Field | Value |
|---|---|
| State | DONE |
| Parent sprint | Sprint 06 |
| Now | Completed 2025-12-04. |
| Waiting on | None. |
| Next | None. |
| Last touched | 2025-12-04 |
Continued from: Authentication bootstrap follow-up.
Acceptance
- Server shuts down cleanly with multiple active sessions.
- Client emits a logout message when ending a session.
- Heartbeat detects dropped connections within a configurable window.
- Disconnect closes currencies window and pressing disconnect crashes client no longer happen.
Tasks
| Task | State | Start | End | Description |
|---|---|---|---|---|
| Implement session cancellation | DONE | 2025-12-04 | 2025-12-04 | Cancel all active sessions when the server stops, so it can shut down cleanly under SIGINT or programmatic shutdown. |
| Add a logout message | DONE | 2025-12-04 | 2025-12-04 | Add a logout message type so the client can cleanly end its session, mirroring the existing login flow. |
| Implement client heartbeat for disconnect detection | DONE | 2025-12-04 | 2025-12-04 | Client sends periodic heartbeats so it (and the server) detect dropped connections rather than waiting on a stalled read. |
Decisions
- Explicit session list, not hierarchical cancellation
- the
Boost.Asio
cancellation_signalone-slot limitation killed the hierarchical approach. Server now ownsstd::list<session>and iterates on stop.
Out of scope
- Reconnection / resilience semantics (still on the backlog).
See also
- Authentication bootstrap follow-up (sprint 05) — predecessor.
Carried the POSTPONED
Implement session cancellationitem.