Refactor backend and frontend cleanup paths

This commit is contained in:
curo1305
2026-06-16 11:50:17 +02:00
parent 6b56763689
commit e97ca164d7
29 changed files with 1106 additions and 2280 deletions
+2 -9
View File
@@ -496,15 +496,8 @@ async def test_invalid_grant_sets_requires_reauth(
assert "re-authentication" in resp.json().get("detail", "").lower() or \
"reconnect" in resp.json().get("detail", "").lower()
# The test checks the 503 response — the DB REQUIRES_REAUTH state transition is
# handled by _call_cloud_op in cloud.py (which is invoked by the real backend flow).
# In this test we monkeypatched get_storage_backend_for_document directly, so
# documents.py's except CloudConnectionError block fires, returning 503.
# The REQUIRES_REAUTH DB state is written by _call_cloud_op, not by documents.py.
# For this test we verify: (1) 503 returned, and (2) the conn was not status="ACTIVE"
# after the call — since the monkeypatch bypasses _call_cloud_op, we re-check conn status.
# The 503 path in documents.py does NOT update conn.status — that is _call_cloud_op's job.
# We verify the HTTP contract here; the DB transition is covered by the cloud.py unit tests.
# This test verifies the document content endpoint's HTTP contract when the
# storage layer reports an invalid cloud grant.
# ── CLOUD-06: Disconnect / credential deletion ────────────────────────────────