coder13 / coder13/LetsCube

Add a feature-flagged PostgreSQL solve-history read API

Offen
#174 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
area: data area: results enhancement priority: P1
Vorherrschende Sprache
JavaScript
Sterne
30
Forks
9
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

## 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

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginne mit der Abhängigkeit #199 und den damit verknüpften #200, #203, #204, #175 und #202 und bestätige anschließend das PostgreSQL Room/RaceSession-Aggregat sowie die Rollout-Voraussetzungen aus #176 und PR #195. Verwende die angegebenen Autorisierungstests für private/hidden/deleted-room, empty-history, disabled und Pagination als erste Validierungspunkte; abgeschlossen bedeutet, dass die authentifizierte Cursor-API und der dokumentierte client/csTimer-Vertrag jedes Akzeptanzkriterium erfüllen, ohne MongoDB-Fallback oder das Protokollieren von Solvedaten.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
postgresql
Bereich
api, authentication, authorization, backend, database, testing
Issue-Typ
Feature
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Ruhig
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.