Skip to content

fix(marketplace): close RI Marketplace poller gaps (pending rows with a listing id, superseded listings, deployment coverage) #1494

Open

Description

@IAmJSD

Problem

The RI Marketplace listing poller from #1289 (the backend slice of #27) leaves gaps where a sale is never recorded:

  1. A pending row that has a real listing id is never polled. A listing saved as pending (AWS gave no status when it was created) that already has a listing_id is never selected by the poll, so it never becomes active and any sale on it is never recorded. This state existed before feat(marketplace): poll RI Marketplace listings and record proceeds and AWS fee (backend slice of #27) #1289.
  2. A sale on a listing that has already been replaced is lost. If a listing sells partially and CUDly then records it as ended under a newer listing id before a poll sees the sale, the earlier listing's proceeds are never recorded. This is the same class as the "known window" documented in feat(marketplace): poll RI Marketplace listings and record proceeds and AWS fee (backend slice of #27) #1289, where a listing is cancelled before its first poll.
  3. The poll doesn't run on every deployment. It runs inside the hourly finalize_revocations task, so it doesn't run on Fargate or CloudFormation deployments where that task isn't scheduled, and switching that task off also stops the poll.

Before exposing proceeds in the API or UI

Acceptance criteria

  • Pending rows with a listing id are polled and move to active or to a terminal state.
  • A listing replaced by a newer one still gets its final settlement recorded.
  • The poll runs on every supported deployment target, or the docs say where it doesn't.

Refs #27, #1289

Activity

  1. IAmJSD commented on Oct 26, 2026

    @IAmJSD
    CollaboratorAuthor

    Claiming: working on this

  2. self-assigned this
    on Oct 26, 2026
  3. IAmJSD commented on Oct 27, 2026

    @IAmJSD
    CollaboratorAuthor

    Status update (2026-10-27, checked against main at 7b86e38): Waiting on an owner decision.

    #1508 fixed gap 1: pending rows that hold a listing id are now polled and settled. It documented gap 3 in docs/DEPLOYMENT.md, listing where finalize_revocations, and so the poll, does not run (Fargate, Cloud Run, GKE, Container Apps), which meets the acceptance criterion. Gap 2 (superseded listings) and the checks before exposing proceeds are still open.

    Left / blocked on: D24, gap 2: keep a superseded listing's sale with a per-listing settlement table (a marketplace_listing_settlements migration keyed by listing_id), or redefine the columns as a cumulative per-RI total? Recommendation: the per-listing table. D23: proceeds are estimates (units sold x listing price, minus 12%), not AWS disbursements. Recommendation: expose them labelled as estimates. Also needs a check against one real closed AWS listing (does the price tier stay active after the listing ends?), which we can't run without a live seller account. Scheduling on Fargate, GCP and Container Apps is tracked in #712.

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions