fix(webhooks): .any() auf JSONB-Spalte crashte jeden Event-Publish (158 failed Outbox-Events) #380
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Bug
Webhook.eventsist ein JSONB-Array-Column (Migration 0042:events JSONB NOT NULL DEFAULT '[]'), KEINE Relationship. Trotzdem riefen zwei StellenWebhook.events.any(event)auf — das existiert nur auf Relationship-Attributen:app/core/webhook_dispatcher.py(Wildcard*-Handler, läuft bei jedem Outbox-Event)app/services/webhook_service.py list_webhooks(event=...)Folge: Jedes Event, das durch den Webhook-Dispatcher lief, crashte mit
Neither 'AnnotatedColumn' nor 'Comparator' object has an attribute 'any'und wurde nach 4 Versuchen als failed markiert — 158 fehlgeschlagene Events (file.deletedvom 2026-08-27) in Produktion, sichtbar über die neue Outbox-UI (Modul 9).Fix (Commit
50d6733)JSONB-Containment statt Relationship-API an beiden Stellen:
Verifikation
tests/test_webhooks.py6/6 passed (3x Service-Event-Filter, 3x Dispatcher-Matching inkl. inactive/other-events-Fälle) — echte PostgreSQL-Test-DB, SQL beweistCAST(webhooks.events AS JSONB) @> ...POST /outbox/replay-all→replayed_count: 158→ nach Worker-Verarbeitung:stats={failed: 0, published: 158}(vorher:{failed: 158})Gefunden über die neue Outbox-UI (Modul 9) — DLQ + Consumer-Registry machten den Fehler sichtbar.