Add a friends hub with realtime online presence
- Vorherrschende Sprache
- JavaScript
- Sterne
- 30
- Forks
- 9
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
## Goal
Give authenticated users one dependable place to see friendships, pending requests, and which friends are currently available to race.
## User experience
Add a `/friends` route reachable from the header/profile menu with:
- online friends first, then offline friends;
- incoming and outgoing pending requests;
- actions to open a profile, accept/decline/cancel a request, unfriend, block, or invite an eligible friend to the current room;
- clear empty, loading, disconnected, and error states;
- a responsive layout that works with the existing mobile navigation.
## Presence contract
- Presence is ephemeral and friends-only in this surface.
- "Online" means the user has at least one authenticated Let’s Cube socket connected.
- Multiple tabs/devices count as one user; offline is emitted only after the last socket disconnects.
- Do not persist or display `last seen` in the MVP.
- Do not create durable "friend came online" notifications in the MVP.
- REST owns the durable friend list; Socket.IO only delivers presence changes. Reconnect must refetch/reconcile durable state.
## Acceptance criteria
- [ ] Add friend-list/request state and selectors without coupling React components directly to sockets.
- [ ] Move friend presence through the global namespace and existing per-user Socket.IO rooms.
- [ ] Compute first-connect/last-disconnect correctly across multiple processes through the Redis adapter.
- [ ] Deliver an initial presence snapshot and incremental updates only for accepted friendships.
- [ ] Handle Redis/socket interruption without deleting friendships or permanently showing stale presence.
- [ ] Add focused server tests for multi-tab, multi-process, blocked/unfriended, and reconnect behavior.
- [ ] Add client tests for sorting, request states, offline/error states, responsive actions, and reconnect reconciliation.
- [ ] Add a Cypress happy path with two authenticated test users.
## Dependencies
- #75 friendship lifecycle
- #105 notification/request state
- #82 public profile links
## Non-goals
- Persistent last-seen timestamps.
- Browser/OS push notifications.
- Direct messaging.
Beitragsleitfaden
Rechercherichtung
Lies die Akzeptanzkriterien und die Abhängigkeiten #75, #105 und #82 und verfolge dann den bestehenden REST-Freundschaftsstatus sowie den Socket.IO-Namespace und die Einstiegspunkte für den Beitritt zu benutzerspezifischen Räumen. Erledigt bedeutet, dass der friends hub, die kurzlebige nur für Freunde sichtbare Anwesenheit, die Reconnect-Abstimmung, die fokussierten Server- und Client-Tests sowie der Cypress-Happy-Path mit zwei Benutzern alle aufgeführten Kriterien erfüllen.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- cypress, javascript, nodejs, react, redis
- Bereich
- backend-api-design, distributed-systems, full-stack, testing-qa
- Issue-Typ
- Feature
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Aktivitätsstatus
- Ruhig
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100