monitoring: alert on failed refunds and stale withdrawal requests #621

Stängd
öppnade 2026-10-08 21:15:44 +00:00 av supernaut · 0 kommentarer
Ägare

What

Alert an operator when a withdrawal request ends stale or invalid, or when its refund fails.

Why

A consumer who withdraws is owed a refund within a statutory window. Today a failed withdrawal refund is at most a log line (bitborg/bitborg-payment#115, bitborg/bitborg-web#326). Nobody reads logs unless something pages them.

Billing-container log alerts (webhook, refund, sweep) are tracked in #692. This issue covers the portal withdrawal path only.

Failing case

Mollie fails a withdrawal refund to a closed card. The billing row is failed. No alert fires, and the refund is never settled.

Fix

  • Loki alert rule on the bitborg-web log lines written by src/lib/withdrawal.ts:
    • [withdraw] refund failed for <sub>, settle by hand
    • [withdraw] request for <sub> ended as stale, settle by hand
    • [withdraw] request for <sub> ended as invalid, settle by hand
  • Route it to email and ntfy like the other money alerts.
  • Runbook entry: settle a failed refund by hand and mark it reviewed.

Depends on bitborg/bitborg-payment#115 and bitborg/bitborg-web#326 for the log prefixes.

Done when

  • A forced refund failure in Mollie test mode on staging fires the alert within minutes.
  • The runbook entry exists.
## What Alert an operator when a withdrawal request ends stale or invalid, or when its refund fails. ## Why A consumer who withdraws is owed a refund within a statutory window. Today a failed withdrawal refund is at most a log line (bitborg/bitborg-payment#115, bitborg/bitborg-web#326). Nobody reads logs unless something pages them. Billing-container log alerts (webhook, refund, sweep) are tracked in #692. This issue covers the portal withdrawal path only. ## Failing case Mollie fails a withdrawal refund to a closed card. The billing row is `failed`. No alert fires, and the refund is never settled. ## Fix - Loki alert rule on the `bitborg-web` log lines written by `src/lib/withdrawal.ts`: - `[withdraw] refund failed for <sub>, settle by hand` - `[withdraw] request for <sub> ended as stale, settle by hand` - `[withdraw] request for <sub> ended as invalid, settle by hand` - Route it to email and ntfy like the other money alerts. - Runbook entry: settle a failed refund by hand and mark it reviewed. Depends on bitborg/bitborg-payment#115 and bitborg/bitborg-web#326 for the log prefixes. ## Done when - [ ] A forced refund failure in Mollie test mode on staging fires the alert within minutes. - [ ] The runbook entry exists.
supernaut 2026-10-19 19:13:32 +00:00
Logga in för att delta i denna konversation.
Ingen milstolpe
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-infra#621
Ingen beskrivning angiven.