#19852·saleor

Transaction event retry can acknowledge a charge while leaving charged total at zero

Author: aviadr1Created Sep 30, 2026Updated Sep 30, 2026

Goal

Ensure a provider's idempotent transactionEventReport retry repairs the transaction's money totals after the first delivery is interrupted.

Steps to reproduce

  1. In a clean test database, create a TransactionItem owned by a payment app.
  2. Report a CHARGE_SUCCESS event for 7.00 with a stable pspReference.
  3. Interrupt recalculate_transaction_amounts immediately after the event's transaction commits. The GraphQL call errors, but the event remains stored and charged_value is still 0.
  4. Redeliver the identical report. The mutation returns alreadyProcessed: true with no error, while charged_value remains 0 instead of 7.00.

A deterministic test using Saleor's ordinary GraphQL test client reproduces this on main (c69c56c).

Expected behavior

A successful retry should leave the accepted event and its derived transaction total consistent. The event should be stored once, and charged_value should be 7.00. A retry that reports success must not leave the money projection unfinished.

Additional context

The mutation commits the event while holding the transaction lock, then releases the lock before recalculating the transaction. The duplicate path skips recalculation. Generated crash/replay histories in due-work-harness #36 first exposed this gap. The earlier Saleor #19836 demonstrates the harness's generated-test adoption; this issue can be pinned with a native Saleor regression without adding the harness as a dependency.

Environment

Current Saleor main (c69c56c), PostgreSQL-backed pytest run. No production incident is claimed.