reconcile: dedupe webhook logs and keep orphans visible past the window #66

Stängd
öppnade 2026-10-01 18:31:50 +00:00 av supernaut · 0 kommentarer
Ägare

Problem

Two gaps left by PR #65 (reconciliation, #62):

  1. handleWebhook logs [webhook] ... left unprocessed (and the refunded or charged-back variant) on every reconcile pass for each orphan. One stuck payment yields about 4,000 lines over the 14-day window. Only the [reconcile] ... needs manual review line is deduplicated, and only in memory, so a restart re-logs it.
  2. A first payment stuck for longer than the 14-day window drops out of reconciliation with no further signal. The Mollie subscription created by the failed attempt keeps charging until a renewal surfaces as an orphan.

Fix

  • Suppress or once-log the [webhook] lines when called from reconcile.
  • Persist the orphan marker (needs a migration) so a restart does not re-alert, and so an orphan that leaves the window stays visible until an operator resolves it.
  • Optional: list Mollie subscriptions too, so an orphan subscription is caught before it charges.

Done when

One orphan produces one alertable line, survives a restart without re-alerting, and stays listed past the window until resolved.

## Problem Two gaps left by PR #65 (reconciliation, #62): 1. `handleWebhook` logs `[webhook] ... left unprocessed` (and the refunded or charged-back variant) on every reconcile pass for each orphan. One stuck payment yields about 4,000 lines over the 14-day window. Only the `[reconcile] ... needs manual review` line is deduplicated, and only in memory, so a restart re-logs it. 2. A first payment stuck for longer than the 14-day window drops out of reconciliation with no further signal. The Mollie subscription created by the failed attempt keeps charging until a renewal surfaces as an orphan. ## Fix - Suppress or once-log the `[webhook]` lines when called from `reconcile`. - Persist the orphan marker (needs a migration) so a restart does not re-alert, and so an orphan that leaves the window stays visible until an operator resolves it. - Optional: list Mollie subscriptions too, so an orphan subscription is caught before it charges. ## Done when One orphan produces one alertable line, survives a restart without re-alerting, and stays listed past the window until resolved.
supernaut lade till detta till projektet Bitborg Payment 2026-10-01 18:57:47 +00:00
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#66
Ingen beskrivning angiven.