Skip to content

Add a feature-flagged PostgreSQL solve-history read API #174

Description

@coder13

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

Unlocks

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: dataMongoDB, PostgreSQL, migrations, backfills, and data integrityarea: resultsSolves, scrambles, history, statistics, and exportsenhancementNew feature or requestpriority: P1High-priority work for the next delivery cycle

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions