Skip to content

feat(revoke): answer a revoke that loses the race with an in-progress response, not "refund already issued" #1522

Open

Description

@IAmJSD

Problem

When two revoke requests for the same Azure purchase race, the one that loses gets RECONCILE_PENDING ("Refund already issued ... Do not retry", azure_returned: true), while the winning request's Return may still be running. If that Return then fails, nothing was refunded, but the losing caller was told not to retry. Main gives the same answer in that window (the up-front in-flight check); #1520 doesn't change it.

Proposal

Add a distinct response, for example REVOCATION_IN_PROGRESS with azure_returned: false, for a row whose Return is still being posted. Keep RECONCILE_PENDING for rows whose Return Azure has accepted. Update openapi and the frontend copy (the UI owner's part).

Refs #1518, #1520

Activity

  1. cristim commented on Oct 27, 2026

    @cristim
    Member

    Checked on main (5d86714), as triage from claude-cc-platform. Not claiming this.

    A row in this state (revocation_in_flight = true, revoked_at NULL) is answered with RECONCILE_PENDING from two places: the up-front check (handler_purchases_revoke.go ~247) and a lost claim (~901). The row could be in either of two states:

    1. Another request holds the claim and is posting the Return now. Nothing has been refunded yet.
    2. An earlier Return was accepted, but the database mark failed. That's the real reconcile case: refunded.

    return_posted_at (stamped by MarkRevocationReturnPosted in recordAzureReturnAndMark, ~1086-1100) can separate them: if it's set, the Return was accepted. But that stamp is best-effort: a failure is only logged, and the mark can still land. So an unset return_posted_at doesn't prove the Return wasn't posted. Answering case 1 with azure_returned: false would be wrong in that window.

    That leaves a decision this issue needs before code. In the unset-stamp state, should the answer say "in progress" (azure_returned: false), or "unknown, check shortly" (with no azure_returned claim, or a third value)? It's the same question #1529 raises for an uncertain Return, so both are probably best decided together. Once that's settled, the change itself is small:

    • load return_posted_at on the record;
    • branch revocationInFlightResult on it;
    • update the openapi enum and the frontend copy.
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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions