fix(backend): redact retryable MAX storage failures
CI / ruff · pytest (pull_request) Successful in 2m4s

Refs #82
This commit is contained in:
Pavel Eliseev
2026-10-04 16:04:38 +03:00
parent 64655ad934
commit 461c3d02ea
2 changed files with 17 additions and 1 deletions
+6 -1
View File
@@ -10,6 +10,7 @@ from fastapi import APIRouter, Depends, HTTPException, Request
from fastapi.security import HTTPAuthorizationCredentials, HTTPBearer
from pydantic import BaseModel, ConfigDict
from sqlalchemy import select
from sqlalchemy.exc import SQLAlchemyError
from app.config import get_settings
from app.core import clock
@@ -106,5 +107,9 @@ async def webhook(request: Request) -> dict[str, bool]:
raise HTTPException(422, "event must be an object")
from app.channels.max_bot import handle_update
await handle_update(event)
try:
await handle_update(event)
except SQLAlchemyError:
# Let MAX retry; do not log DB exception parameters containing identity data.
raise HTTPException(503, "notification storage unavailable") from None
return {"success": True}