withdrawal: alert an operator when a refund fails or a request goes stale #326

Öppen
öppnade 2026-10-08 21:12:38 +00:00 av supernaut · 0 kommentarer
Ägare

What

refund failed ... settle by hand and request ... ended as stale/invalid, settle by hand are console.error lines only.

Why

A consumer is owed a timely refund. A log line nobody watches is not a process.

Failing case

Billing returns refundStatus: failed. The user sees "refund issue". No operator hears about it until someone searches the logs.

Fix

Emit one fixed, greppable log line per case and add a log-based alert on it. Optionally count withdrawal rows with neither withdrawn_at nor rejection older than 24 hours.

Done when

  • A failed refund or a stale request notifies an operator within minutes.
  • The alert has a runbook entry saying what "settle by hand" means.

Plan outline

  1. Decide the signal: a log line with a stable prefix, or a DB query exposed as a metric.
  2. Web: standardise the log lines for failed, stale, invalid and queued-over-24h, with a test that asserts the strings.
  3. Infra: add the alert rule and contact route (separate repo and issue, linked from this one).
  4. Docs: add a runbook entry for settling a failed refund by hand.
  5. Verify end to end with a forced failure in a non-prod stack before closing.
## What `refund failed ... settle by hand` and `request ... ended as stale/invalid, settle by hand` are `console.error` lines only. ## Why A consumer is owed a timely refund. A log line nobody watches is not a process. ## Failing case Billing returns `refundStatus: failed`. The user sees "refund issue". No operator hears about it until someone searches the logs. ## Fix Emit one fixed, greppable log line per case and add a log-based alert on it. Optionally count withdrawal rows with neither `withdrawn_at` nor `rejection` older than 24 hours. ## Done when - [ ] A failed refund or a stale request notifies an operator within minutes. - [ ] The alert has a runbook entry saying what "settle by hand" means. ## Plan outline 1. Decide the signal: a log line with a stable prefix, or a DB query exposed as a metric. 2. Web: standardise the log lines for failed, stale, invalid and queued-over-24h, with a test that asserts the strings. 3. Infra: add the alert rule and contact route (separate repo and issue, linked from this one). 4. Docs: add a runbook entry for settling a failed refund by hand. 5. Verify end to end with a forced failure in a non-prod stack before closing.
supernaut lade till detta till projektet Bitborg Web 2026-10-08 21:14:49 +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-web#326
Ingen beskrivning angiven.