fix(gateway): clean service restart notifications
This commit is contained in:
@@ -597,6 +597,35 @@ async def test_send_uses_reply_fallback_for_hermes_dm_topics():
|
||||
assert "direct_messages_topic_id" not in call_log[0]
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_send_uses_reply_anchor_when_direct_topic_fallback_metadata_exists():
|
||||
"""Restart/update replay metadata keeps the anchor authoritative when present."""
|
||||
adapter = _make_adapter()
|
||||
call_log = []
|
||||
|
||||
async def mock_send_message(**kwargs):
|
||||
call_log.append(kwargs)
|
||||
return SimpleNamespace(message_id=777)
|
||||
|
||||
adapter._bot = SimpleNamespace(send_message=mock_send_message)
|
||||
|
||||
result = await adapter.send(
|
||||
chat_id="123",
|
||||
content="test message",
|
||||
metadata={
|
||||
"thread_id": "20197",
|
||||
"telegram_dm_topic_reply_fallback": True,
|
||||
"direct_messages_topic_id": "20197",
|
||||
"telegram_reply_to_message_id": "462",
|
||||
},
|
||||
)
|
||||
|
||||
assert result.success is True
|
||||
assert call_log[0]["reply_to_message_id"] == 462
|
||||
assert call_log[0]["message_thread_id"] == 20197
|
||||
assert "direct_messages_topic_id" not in call_log[0]
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_send_created_private_topic_uses_message_thread_without_anchor():
|
||||
"""Topics created via createForumTopic are addressable by message_thread_id directly."""
|
||||
|
||||
Reference in New Issue
Block a user