fix(zulip): use PATCH /api/v1/messages/{id} for message editing
CI / validate (pull_request) Failing after 2s
CI / validate (pull_request) Failing after 2s
Zulip API edits messages via PATCH /api/v1/messages/{message_id}
(POST returns 405 on this endpoint). Also:
- edit_message() now returns SendResult (not bool) for Gateway compatibility
- Clean up duplicate gateway instances before restart
This commit is contained in:
@@ -910,10 +910,11 @@ class ZulipAdapter(BasePlatformAdapter):
|
|||||||
# Send actual content
|
# Send actual content
|
||||||
result = await self._send_api_call(payload)
|
result = await self._send_api_call(payload)
|
||||||
if result and result.get("id"):
|
if result and result.get("id"):
|
||||||
|
msg_id = str(result["id"])
|
||||||
self._health_stats["send_count"] += 1
|
self._health_stats["send_count"] += 1
|
||||||
return SendResult(
|
return SendResult(
|
||||||
success=True,
|
success=True,
|
||||||
message_id=str(result["id"]),
|
message_id=msg_id,
|
||||||
)
|
)
|
||||||
|
|
||||||
self._health_stats["send_errors"] += 1
|
self._health_stats["send_errors"] += 1
|
||||||
@@ -942,8 +943,9 @@ class ZulipAdapter(BasePlatformAdapter):
|
|||||||
"content": truncated,
|
"content": truncated,
|
||||||
}
|
}
|
||||||
try:
|
try:
|
||||||
|
# Zulip API: PATCH /api/v1/messages/{message_id} with content in body
|
||||||
resp, status = await self._api_call(
|
resp, status = await self._api_call(
|
||||||
"POST", f"/api/v1/messages/{int(message_id)}",
|
"PATCH", f"/api/v1/messages/{int(message_id)}",
|
||||||
data=payload,
|
data=payload,
|
||||||
)
|
)
|
||||||
if resp:
|
if resp:
|
||||||
|
|||||||
Reference in New Issue
Block a user