Skip to content

P0: GET /api/transactions?order=desc is ingest-cursor not trade date (2024 Khanna is page 1) #2180

Description

@jaywedgeworth22

Live 2026-08-23 CURSOR review

GET https://congress.trade/api/transactions?order=desc&limit=8 returns Ro Khanna 2024-03/04 PTR rows (H-2024-8220192, source=local_mac, firstSeenAt=2026-08-10) as if they were the newest trades.

Tests in app/src/delivery/__tests__/buildTransactionsQuery.test.ts document that omitted/desc order is ORDER BY t.cursor_seq, not tx_date / first_seen_at. A large historical backfill with high cursor ids wins the public "latest" snapshot.

The web Trades tab with the default 3-month window is fine (Ed Case AAPL 2026-08-13 on page 1). API clients, Delivery consumers, and any iOS path that uses unwindowed order=desc are not.

Fix

Default public newest-first to COALESCE(first_seen_at, filed_date, tx_date) (or document sort=tx_date and make the web/iOS/docs all use it). Add a contract test that a 2024 backfill row cannot outrank a 2026 primary row on order=desc.

Keepouts: extract/halt, Infisical.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions