Recurnix docs

Docs › Releases › 1.11 › Release notes

Recurnix 1.11 release notes

Released 2026-07-31. Recurnix 2.11 is newer.

Recurnix already refused to record the same payment twice. It could still take the same payment three times.

Those sound like the same guarantee. They are not, and the difference is where the key comes from.

PaymentService::pay() will not write a second Transaction for a gateway_txn_id it has already seen, and a unique index enforces it even if two processes race. That is real protection, and it has been there since v0.66. But gateway_txn_id is minted by the gateway. It does not exist until the charge has already gone through and the answer has come back. It cannot protect the call that produces it.

The nightly auto-pay run called the gateway, then wrote the transaction. Everything between those two lines was unprotected: a read timeout, a killed worker, a deploy landing mid-run, the database going away for a second. The money moves; Recurnix never hears; the invoice is still unpaid with a positive balance; tomorrow night it is selected again.

We measured it rather than reasoned about it. A gateway that takes the money and then throws a connection timeout — which is exactly what StripeGateway does when Stripe processes a charge and the response is lost — against one 25.00 invoice:

night 1  charges_made=1  txns_recorded=0  balance=25.00  overdue
night 2  charges_made=2  txns_recorded=0  balance=25.00  overdue
night 3  charges_made=3  txns_recorded=0  balance=25.00  overdue
night 4  charges_made=3  txns_recorded=0  balance=25.00  overdue

money taken = 75.00 USD    money recorded = 0.00 USD

It stops at three only because autopay_max_attempts defaults to three. The attempts counter bounded the damage. It never prevented it — a counter is not a key.

The fix

A row written before the money moves, in a new payment_attempts table, keyed on something that already exists at that moment: the invoice and the attempt number. Charge. Then close the row out.

If a later run finds that row still unresolved, it does not charge. "Unresolved" means precisely we do not know whether the money moved, and guessing is what caused the problem in the first place.

Same probe, same lost responses, against the fixed code:

night 1  charges_made=1  txns=0  balance=25.00  attempts_row=1/1 pending
night 2  charges_made=1  txns=0  balance=25.00  attempts_row=1/1 pending
night 3  charges_made=1  txns=0  balance=25.00  attempts_row=1/1 pending
night 4  charges_made=1  txns=0  balance=25.00  attempts_row=1/1 pending

One charge. Then nothing, until a person says which way it went.

Which is where you come in

Billing → Payment attempts now carries a red badge with the number of charges we never got an answer about. Each one has a copyable idempotency key — paste it into your gateway's search and you will find the charge, or you will not. Then tell Recurnix which:

  • It did charge — records the payment against the invoice using that key as the reference, so if the gateway's own webhook turns up later carrying the same key, the unique index refuses the duplicate. The invoice settles.
  • It never charged — writes the attempt off. Auto-pay is free to try that invoice again tonight, on a fresh attempt number and therefore a fresh key.

Both ask you to note what you found. The note is kept.

Three smaller things found on the way

StripeGateway::chargeToken() was a bare HTTP POST with no Idempotency-Key header and no timeout. Both are now set. Be clear about what the header buys: Stripe honours a key for 24 hours and the nightly run is 24 hours apart, so it protects the in-run window — a duplicate cron firing, two workers, a retry inside the HTTP client — and not tomorrow. Tomorrow is the attempt row's job.

A gateway can report a payment and hand back no reference at all. That wrote gateway_txn_id = NULL, and MySQL lets a unique index hold any number of NULLs — so the duplicate protection on payments was quietly switched off for exactly the gateways least able to tell us what happened. The attempt's key now stands in.

The nightly summary line was counting charges it had not recorded. If an invoice was settled by a webhook while the charge was in flight, the run still added it to autopay=N. It now reports what it actually wrote.

What is not covered

The Stripe leg follows Stripe's documented behaviour, but this installation has no Stripe keys, so it has not been exercised against live Stripe. Everything else above was measured end to end — including both admin actions, driven through the real screen, against a real invoice.


Last modified: 16 November 2026 · This page documents Recurnix, self-hosted billing and automation. Ask a question.