reconcile: detect and repair mollie records with no local match #62

Stängd
öppnade 2026-10-01 15:10:27 +00:00 av supernaut · 1 kommentar
Ägare

Problem

Two failure windows leave Mollie and our database out of step with nothing to repair them:

  1. The Kanidm grant fails on a first payment and keeps failing past Mollie's webhook retry schedule (about 26 h). The Mollie subscription exists, but no local record is committed. It renews and charges, and that renewal webhook stays unprocessed.
  2. A Mollie payment is accepted, but the local charge insert fails. The webhook finds no charge and leaves the event unprocessed for manual review.

Done when

A periodic job lists Mollie subscriptions and payments for the last N days, matches them on metadata against local rows, and logs and alerts on any orphan. Repair is either automatic (adopt or cancel and refund) or a documented manual step. A test covers each window.

## Problem Two failure windows leave Mollie and our database out of step with nothing to repair them: 1. The Kanidm grant fails on a first payment and keeps failing past Mollie's webhook retry schedule (about 26 h). The Mollie subscription exists, but no local record is committed. It renews and charges, and that renewal webhook stays unprocessed. 2. A Mollie payment is accepted, but the local charge insert fails. The webhook finds no charge and leaves the event unprocessed for manual review. ## Done when A periodic job lists Mollie subscriptions and payments for the last N days, matches them on metadata against local rows, and logs and alerts on any orphan. Repair is either automatic (adopt or cancel and refund) or a documented manual step. A test covers each window.
supernaut lade till detta till projektet Bitborg Payment 2026-10-01 15:10:38 +00:00
Upphovsperson
Ägare

Shipped in PR #65 (merged): reconciliation after each sweep, both failure windows covered, two review rounds. The remaining gaps are tracked separately: #66 (webhook log dedupe, orphans kept visible past the 14-day window, optional subscription listing) and bitborg-infra#510 (alert on the [reconcile] ... needs manual review line). Closing this one.

Not live yet: production pins billing image v0.2.1, which predates this change. It reaches prod with the next release and pin bump.

Shipped in PR #65 (merged): reconciliation after each sweep, both failure windows covered, two review rounds. The remaining gaps are tracked separately: #66 (webhook log dedupe, orphans kept visible past the 14-day window, optional subscription listing) and bitborg-infra#510 (alert on the `[reconcile] ... needs manual review` line). Closing this one. Not live yet: production pins billing image v0.2.1, which predates this change. It reaches prod with the next release and pin bump.
supernaut refererade till detta ärende från en incheckning 2026-10-01 21:45:03 +00:00
supernaut refererade till detta ärende från en incheckning 2026-10-02 17:57:02 +00:00
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#62
Ingen beskrivning angiven.