Add a feature-flagged PostgreSQL solve-history read API
- Lingua principale
- JavaScript
- Stelle
- 30
- Fork
- 9
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
## Goal
Expose durable per-user solve history from PostgreSQL only after the Room/RaceSession aggregate is authoritative. Do not build this API around the legacy room-embedded attempt model.
## Read contract
- Require the authenticated user.
- Return cursor-paginated completed solves with stable solve ID, event, time, +2/DNF penalties, scramble, Room/RaceSession reference, and timestamps.
- Authorize private, hidden, expired, and deleted-room history server-side. Do not return passwords, access codes, room membership, or moderation data.
- Query the canonical PostgreSQL `Solve → Attempt → RaceSession → Room` relationship; `Solve.room_id` is only a temporary migration compatibility field and must not define API semantics.
- Use a session-aware deterministic index and cursor compatible with the final schema.
- Gate the client endpoint behind configuration and retain an explicit disable path, not a MongoDB fallback after aggregate cutover.
- Instrument latency and error/disable behavior without logging solve data or identity.
## Acceptance criteria
- [ ] The API is authenticated, cursor-paginated, and stable across concurrent new solves.
- [ ] It returns the final Room/RaceSession-shaped representation and correct penalties/scrambles.
- [ ] Private-room, hidden/deleted-room, empty-history, disabled, and pagination authorization tests pass.
- [ ] Disabled PostgreSQL behavior is explicit and does not read MongoDB room/result state.
- [ ] Client history and csTimer-export consumers are documented against the final contract.
## Dependencies
- #199, including #200, #203, #204, #175, and #202.
- Stable production rollout from #176 and settled room ownership/admin semantics from PR #195.
- The PostgreSQL aggregate cutover and reconciliation must complete before implementation begins.
## Unlocks
- #160
- #161
- #163
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Start with dependency #199 and its linked #200, #203, #204, #175, and #202, then confirm the PostgreSQL Room/RaceSession aggregate and rollout prerequisites from #176 and PR #195. Use the stated private/hidden/deleted-room, empty-history, disabled, and pagination authorization tests as the first validation points; done means the authenticated cursor API and documented client/csTimer contract meet every acceptance criterion without MongoDB fallback or solve-data logging.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- postgresql
- Ambito
- api, authentication, authorization, backend, database, testing
- Tipo di issue
- Funzionalità
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Stato di attività
- Tranquilla
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100