diff --git a/nostr/nostr_client.py b/nostr/nostr_client.py index c51d19d..dbc410e 100644 --- a/nostr/nostr_client.py +++ b/nostr/nostr_client.py @@ -152,10 +152,13 @@ class NostrClient: def _filters_for_direct_messages(self, public_keys: List[str], since: int) -> List: # NIP-17/NIP-59: subscribe to kind 1059 gift wraps addressed to our merchants. # With gift wrapping, outgoing messages are self-wrapped (same p-tag filter). + # + # Do NOT apply `since` here. Per NIP-59, gift wraps use randomized past + # timestamps (up to 2 days back) to defeat metadata correlation, so a + # `since` derived from the latest DM in our DB will reject fresh wraps + # whose randomized created_at is older than that window. Server-side + # dedup + the client's is_duplicate_event() guard handle replays. gift_wrap_filter: dict = {"kinds": [1059], "#p": public_keys} - if since and since != 0: - gift_wrap_filter["since"] = since - return [gift_wrap_filter] def _filters_for_stall_events(self, public_keys: List[str], since: int) -> List: