corvix.notifications.dedupe =========================== .. py:module:: corvix.notifications.dedupe .. autoapi-nested-parse:: Idempotency / deduplication helpers for notification delivery. Functions --------- .. autoapisummary:: corvix.notifications.dedupe.dedupe_events corvix.notifications.dedupe.make_seen_set Module Contents --------------- .. py:function:: dedupe_events(events: list[corvix.notifications.models.NotificationEvent], seen: set[str]) -> tuple[list[corvix.notifications.models.NotificationEvent], set[str]] Filter *events* to those not already in *seen*. Returns a tuple of (fresh_events, updated_seen_set). The returned set is a new object; the caller should replace their reference so the state advances correctly across poll cycles. Parameters ---------- events: Candidate events from the current poll cycle. seen: Set of ``event_id`` values already delivered in previous cycles. .. py:function:: make_seen_set(events: list[corvix.notifications.models.NotificationEvent]) -> set[str] Build an initial ``seen`` set from a list of already-delivered events.