Add a feature-flagged PostgreSQL solve-history read API
- Lenguaje dominante
- JavaScript
- Estrellas
- 30
- Forks
- 9
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
## 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
Guía de contribución
Línea de trabajo
Empieza con la dependencia #199 y sus #200, #203, #204, #175 y #202 vinculados, y después confirma el agregado PostgreSQL Room/RaceSession y los prerrequisitos de despliegue de #176 y PR #195. Usa las pruebas de autorización indicadas para private/hidden/deleted-room, empty-history, disabled y pagination como primeros puntos de validación; terminado significa que la API de cursores autenticada y el contrato documentado de client/csTimer cumplen todos los criterios de aceptación sin fallback a MongoDB ni registro de datos de resolución.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- postgresql
- Área
- api, authentication, authorization, backend, database, testing
- Tipo de issue
- Nueva funcionalidad
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Estado de actividad
- Tranquilo
- Claridad
- Bastante claro
- Aptitud para principiantes
- 35/100