test: cover WhatsApp read receipts

maintainer edit: add focused coverage for the new best-effort mark_read path and remove an unused helper argument.
This commit is contained in:
chengyongru
2026-06-30 15:21:25 +08:00
committed by Xubin Ren
parent 839d1ecfb1
commit 4c0e9b9f46
2 changed files with 75 additions and 4 deletions
+2 -4
View File
@@ -499,9 +499,7 @@ class WhatsAppChannel(BaseChannel):
self._self_jids.add(jid)
self._self_jids.add(_bare_jid(jid))
async def _send_read_receipt(
self, client: Any, info: Any, source: Any, message_id: str
) -> None:
async def _send_read_receipt(self, client: Any, source: Any, message_id: str) -> None:
"""Send a read receipt (blue double-check) for an incoming message.
Best-effort: any failure is logged at debug level and swallowed so it
@@ -559,7 +557,7 @@ class WhatsAppChannel(BaseChannel):
self._processed_message_ids.popitem(last=False)
# Mark the incoming message as read (blue double-check). Best-effort.
await self._send_read_receipt(client, info, source, message_id)
await self._send_read_receipt(client, source, message_id)
participant_jid = _normalize_jid(_safe_attr(source, "Sender"))
sender_alt_jid = _normalize_jid(_safe_attr(source, "SenderAlt"))