fix: [50] stop a failing Matrix hook from blocking all subsequent hooks #52

Merged
hobbypunk merged 1 commit from bug/50 into main 2026-10-12 15:17:33 +00:00
Owner

Problem

Ein einzelner kaputter Matrix-Hook (abgelaufener Refresh-Token, geändertes Passwort, verlassener Room) ließ den ganzen Benachrichtigungs-Job crashen – alle Hooks nach ihm in der Iteration verloren die Nachricht. CheckExpiringJob hat zusätzlich über sein ensure die notified_expiring_event-Marker gesetzt, obwohl Hooks nie beliefert wurden – dauerhafter, stiller Informationsverlust.

Lösung

  • MatrixJob (neu, erbt von ApplicationJob) mit deliver_to: per-Hook rescue Messaging::Matrix::Error, Warn-Log plus Sentry-Report mit Login/Room-Kontext, Iteration läuft für die übrigen Hooks weiter
  • CheckExpiringJob: Marker nur setzen, wenn alle Hooks beliefert wurden
  • NotifyNegativeBalanceJob: GiroCode-Upload vor der Text-Nachricht, alle drei Schritte pro Hook in einer Rescue-Einheit
  • NotifyJob / BalanceInformationJob: Zustellung über deliver_to

Tests

Pro Job ein neuer Test: kaputter Hook (500 auf seinen Room) blockiert die intakten Hooks nicht; beim CheckExpiringJob zusätzlich, dass der Marker bei Teil-Fehlschlag nicht gesetzt wird.

Closes #50

## Problem Ein einzelner kaputter Matrix-Hook (abgelaufener Refresh-Token, geändertes Passwort, verlassener Room) ließ den ganzen Benachrichtigungs-Job crashen – alle Hooks nach ihm in der Iteration verloren die Nachricht. `CheckExpiringJob` hat zusätzlich über sein `ensure` die `notified_expiring_event`-Marker gesetzt, obwohl Hooks nie beliefert wurden – dauerhafter, stiller Informationsverlust. ## Lösung - **`MatrixJob`** (neu, erbt von `ApplicationJob`) mit `deliver_to`: per-Hook `rescue Messaging::Matrix::Error`, Warn-Log plus Sentry-Report mit Login/Room-Kontext, Iteration läuft für die übrigen Hooks weiter - **`CheckExpiringJob`**: Marker nur setzen, wenn **alle** Hooks beliefert wurden - **`NotifyNegativeBalanceJob`**: GiroCode-Upload vor der Text-Nachricht, alle drei Schritte pro Hook in einer Rescue-Einheit - **`NotifyJob` / `BalanceInformationJob`**: Zustellung über `deliver_to` ## Tests Pro Job ein neuer Test: kaputter Hook (500 auf seinen Room) blockiert die intakten Hooks nicht; beim `CheckExpiringJob` zusätzlich, dass der Marker bei Teil-Fehlschlag nicht gesetzt wird. Closes #50
fix: stop a failing Matrix hook from blocking all subsequent hooks
Some checks failed
CI / Quality / Bundler Audit (pull_request) Successful in 57s
CI / Quality / Brakeman (pull_request) Successful in 1m0s
CI / Quality / RuboCop (pull_request) Successful in 1m1s
CI / Quality (pull_request) Successful in 0s
CI / Tests / Unit (pull_request) Successful in 2m11s
CI / Tests / System (pull_request) Successful in 52s
PR Triage / Triage pull request-1 (pull_request) Successful in 6s
PR Triage / Triage pull request (pull_request) Successful in 0s
CI / Tests (pull_request) Has been cancelled
CI / Container (pull_request) Has been cancelled
CI / Deploy (pull_request) Has been cancelled
CI / Container / Build and push (pull_request) Has been cancelled
CI / Tests / Coverage (pull_request) Has been cancelled
72942416b9
A single broken hook (expired token, changed password, left room) crashed
the whole notification job, so every hook after it silently lost the
message. CheckExpiringJob even marked undelivered sessions as notified
via its ensure block, permanently silencing them.

- introduce MatrixJob with deliver_to: per-hook rescue on
  Messaging::Matrix::Error, warn log + Sentry report with login/room
  context, iteration continues for the remaining hooks
- CheckExpiringJob only sets notified_expiring_event when all hooks were
  served
- NotifyNegativeBalanceJob uploads the girocode before the text message
  and treats all three steps per hook as one rescue unit

---------

Co-Authored-By: opencode (Mistral GLM) <opencode-agent[bot]@hoppe-dev.eu>
forgejo-actions changed title from [50] fix: stop a failing Matrix hook from blocking all subsequent hooks to fix: [50] fix: stop a failing Matrix hook from blocking all subsequent hooks 2026-10-12 15:01:18 +00:00
forgejo-bot scheduled this pull request to auto merge when all checks succeed 2026-10-12 15:01:18 +00:00
forgejo-bot canceled auto merging this pull request when all checks succeed 2026-10-12 15:01:59 +00:00
forgejo-bot scheduled this pull request to auto merge when all checks succeed 2026-10-12 15:01:59 +00:00
hobbypunk changed title from fix: [50] fix: stop a failing Matrix hook from blocking all subsequent hooks to fix: [50] stop a failing Matrix hook from blocking all subsequent hooks 2026-10-12 15:07:01 +00:00
forgejo-bot canceled auto merging this pull request when all checks succeed 2026-10-12 15:07:07 +00:00
forgejo-bot scheduled this pull request to auto merge when all checks succeed 2026-10-12 15:07:07 +00:00
hobbypunk deleted branch bug/50 2026-10-12 15:17:33 +00:00
Sign in to join this conversation.
No description provided.