Skip to content

Commit ca9e5a5

Browse files
committed
fix: normalize adapter send result
1 parent 4c4c62a commit ca9e5a5

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

publications.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
"""Publication processing pipeline service."""
33

44
import base64
5-
import magic
65
import uuid
76
from typing import Optional
87

8+
import magic
99
from sqlalchemy.orm import Session
1010

1111
from keys import KeyManager
@@ -231,7 +231,11 @@ def _publish_online_content(
231231
)
232232
raise AdapterIntegrationError("Failed to send message via adapter.")
233233

234-
result = pipe.get("result") or {}
234+
result = pipe.get("result")
235+
if isinstance(result, bool):
236+
result = {"success": result}
237+
elif not isinstance(result, dict):
238+
result = {}
235239

236240
# Refresh may have happened even if the send itself failed downstream
237241
# (e.g. token refreshed, then the HTTP call or attachment step failed).

0 commit comments

Comments
 (0)