fix: reorder notification DELETE routes so bulk clear matches first

FastAPI matches routes in declaration order. The DELETE /notifications
endpoint (bulk clear) was registered AFTER DELETE /notifications/{id},
so the path parameter route intercepted all requests to the bulk route,
causing a 422 UUID validation error instead of hitting clear_all.

Moved clear_all_notifications above dismiss_notification in the router.
Added regression test to verify route order.

Quality gates: pytest (22 passed)
This commit is contained in:
Alex Blank
2026-05-29 16:54:01 +02:00
parent 5f499ec1b0
commit 3d1f8d9cf7
4 changed files with 51 additions and 17 deletions
+1 -5
View File
@@ -139,11 +139,7 @@ async def publish_lifecycle_event(
if not _should_notify(event_type, effective_status):
return
severity = (
"error"
if event_type == "instance.error"
else "success"
)
severity = "error" if event_type == "instance.error" else "success"
title = _derive_title(event_type)
try: