fix(restart): deliver completion after channel reconnects (#4931)

This commit is contained in:
chengyongru
2026-07-15 01:08:39 +08:00
committed by GitHub
parent 37165b0db0
commit 88c38e9b38
19 changed files with 284 additions and 55 deletions
+6 -5
View File
@@ -113,17 +113,18 @@ def test_guess_send_file_type_by_mime() -> None:
@pytest.mark.asyncio
async def test_send_exception_caught_not_raised() -> None:
"""Exceptions inside send() must not propagate."""
async def test_send_exception_propagates_for_manager_retry() -> None:
"""Delivery failures must propagate to the channel manager."""
channel = QQChannel(QQConfig(app_id="app", secret="secret", allow_from=["*"]), MessageBus())
channel._client = _FakeClient()
with patch.object(
channel, "_send_text_only", new_callable=AsyncMock, side_effect=RuntimeError("boom")
) as send_text:
await channel.send(
OutboundMessage(channel="qq", chat_id="user1", content="hello")
)
with pytest.raises(RuntimeError, match="boom"):
await channel.send(
OutboundMessage(channel="qq", chat_id="user1", content="hello")
)
send_text.assert_awaited_once()