test(signal): update echo-discard test for OrderedDict ring

The hardened echo ring (#31250) changes _recent_sent_timestamps from a set
to an OrderedDict, so the reply-detection-cache regression test from the quote
salvage can no longer call .discard(); route it through the new
_consume_sent_timestamp() helper, which is the real echo-removal path.
This commit is contained in:
kshitijk4poor 2026-06-20 20:51:01 +05:30
parent 332f88f6a6
commit 2f86283217

View file

@ -1573,7 +1573,9 @@ class TestSignalQuoteExtraction:
async def test_track_sent_timestamp_keeps_reply_detection_cache_after_echo_discard(self, monkeypatch):
adapter = _make_signal_adapter(monkeypatch)
adapter._track_sent_timestamp({"timestamp": 111222333})
adapter._recent_sent_timestamps.discard(111222333)
# Echo suppression consumes the entry from the recent-sent ring; the
# separate reply-detection cache must still retain it.
adapter._consume_sent_timestamp(111222333)
assert "111222333" in adapter._sent_message_timestamps
assert adapter._quote_references_own_message("111222333", None) is True