provider: retry Mollie 429 with Retry-After and treat 409 as in flight #86

Stängd
öppnade 2026-10-05 12:32:42 +00:00 av supernaut · 1 kommentar
Ägare

Problem

@mollie/api-client 4.6.0 retries only 5xx responses (3 attempts). It does not retry 429. Our adapter has no handling either. A 429 rejects the whole call.

Webhooks recover through Mollie's redelivery. The sweep and reconciliation do not: listPayments and listChargebacks page through everything, and one 429 aborts the pass.

A 409 (same idempotency key while the first request is in flight) also surfaces as a raw error.

Mollie docs

Fix

Wrap Mollie calls in a small retry that handles 429 with Retry-After and a capped number of attempts, and treats 409 as "in flight, retry later". One wrapper in the adapter, not per call site.

Done when

  • A unit test with a fake fetch returning 429 then 200 proves the call succeeds and waits as told.

Found in the Mollie docs audit of 2026-10-05.

## Problem `@mollie/api-client` 4.6.0 retries only 5xx responses (3 attempts). It does not retry 429. Our adapter has no handling either. A 429 rejects the whole call. Webhooks recover through Mollie's redelivery. The sweep and reconciliation do not: `listPayments` and `listChargebacks` page through everything, and one 429 aborts the pass. A 409 (same idempotency key while the first request is in flight) also surfaces as a raw error. ## Mollie docs - Rate limiting: "use retry and backoff logic", honour `Retry-After` (https://docs.mollie.com/reference/rate-limiting). - Idempotency: concurrent requests with the same key get 409; keys expire after 1 hour (https://docs.mollie.com/reference/api-idempotency). ## Fix Wrap Mollie calls in a small retry that handles 429 with `Retry-After` and a capped number of attempts, and treats 409 as "in flight, retry later". One wrapper in the adapter, not per call site. ## Done when - A unit test with a fake fetch returning 429 then 200 proves the call succeeds and waits as told. Found in the Mollie docs audit of 2026-10-05.
supernaut lade till detta till projektet Bitborg Payment 2026-10-05 12:34:45 +00:00
Upphovsperson
Ägare

Folded into #148, which now also covers the 409 handling and retry on write paths. Closing this one. Follow #148.

Folded into #148, which now also covers the 409 handling and retry on write paths. Closing this one. Follow #148.
Logga in för att delta i denna konversation.
Ingen milstolpe
Inget projekt
Inga tilldelade
1 deltagare
Notiser
Förfallodatum
Förfallodatumet är ogiltigt eller utanför gränserna. Använd formatet "åååå-mm-dd".

Inget förfallodatum satt.

Beroenden

Inga beroenden satta

Referens
bitborg/bitborg-payment#86
Ingen beskrivning angiven.