Skip to content

chore(purchases): finish-or-remove GetPendingExecutionsTx (dead after #1037 chose per-row CAS) #1072

Description

@cristim

Background

PR #1037 chose per-row CAS (TransitionExecutionStatus) for atomic claim-then-execute. Intentional and sound design.

GetPendingExecutionsTx was written for an alternative serialisable-transaction design that was superseded.

Problem

GetPendingExecutionsTx (and its tx-based locking scaffolding) became dead code after #1037 landed.

Options

  1. Remove if confirmed dead.
  2. Document as future hook for batch-claim scenarios.

Note

The #1037 CAS choice is intentional and sound. Do not revisit without a separate ADR. This chore is purely cleanup.

Files: internal/config/store_postgres.go (GetPendingExecutionsTx)

Activity

  1. cristim commented on Jun 8, 2026

    @cristim
    MemberAuthor

    Closing as not_planned: GetPendingExecutionsTx is not dead code. It is actively called at internal/api/handler_purchases.go:1508 inside the executePurchase WithTx block, which is exactly the TOCTOU-closing role the comment describes. The function was either re-adopted after #1037 or the issue was filed against an intermediate state. Either way, removing it would break the duplicate-detection path.


    Generated by Claude Code

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