AEROSIM-TS-23
Implement the typed Nebula Socket.IO client
Nebula connects through the shared contract, reconnects with bounded behavior, and surfaces terminal connection failures without duplicating events.
- Verified flow state
- Done
- Owner
- AeroSim Architecture and Delivery
- Feature
- AEROSIM-FT-44
- Component
- Web Application — Socket.IO client
- Repository
- corp-v1-aerosim/corp-v1-aerosim
Delivery scope
Create a Nebula SocketClient that supplies the current access token at connect time, validates FlightState, dispatches only increasing sequences, retries transport loss at 250 ms, 500 ms, and 1000 ms, and removes all listeners on dispose. Primary files: applications/web/src/realtime/socket-client.ts, applications/web/src/realtime/flight-event-store.ts, applications/web/tests/socket-client.test.ts.
Implementation contract
Implementation artifacts
- applications/web/src/realtime/socket-client.ts
- applications/web/src/realtime/flight-event-store.ts
- applications/web/tests/socket-client.test.ts
Inputs
- SocketClientConfig {url,getAccessToken,maxReconnectAttempts:3}
- FlightCommand dispatches and incoming FlightState or ProblemEvent messages
Outputs
- ConnectionState union disconnected|connecting|connected|terminal-error
- Deduplicated ordered FlightState updates in FlightEventStore
Failure boundaries
- Enter terminal-error after three failed reconnect attempts and expose the final transport reason.
- Drop duplicate, decreasing, malformed, or wrong-protocol FlightState without updating the store.
Excluded scope
- Offline command queues, unbounded retry, background synchronization, and physics prediction are not client responsibilities.
Verification steps
- pnpm --filter @aerosim/web test -- socket-client.test.ts
- Advance fake timers through 250/500/1000 ms and assert exactly three reconnects, one terminal error, and no listener after dispose.
Traceability
Dependencies
- AEROSIM-TS-22Canonical ID: TASK-0022
UI/UX applicability
non_visual
This Task owns technical or behavioral acceptance and does not claim direct visual conformance to the approved UI/UX package.
Acceptance evidence
Verified delivery: application PR #33 reviewed head 8a2d612a84a0c66376a02d0f265493e3c889b793, exact-head validation task 1870 succeeded, merged as 7a67bef84c5d02354e877c6bcde1c34bb3d3c497; Wave 6 integrated application head 5e7babdbc9d3749c062995a48da78cc12a43ef1a passed publish task 1879 and validate task 1880. Release completion verified on product 1.0.0.0 at GitOps revision 5d3712d89dfbf7dacd993348e55f497d126c7bf9 with Argo Synced/Healthy, exact image digests, authenticated API/database access, and three-world configured-flight acceptance.
Current evidence boundary
No current implementation, acceptance, release, or deployment evidence is claimed for this planned Task. Any prior implementation may be used only as prototype and discovery evidence.