From c29d20d5c51feb4ad8024e42551f3c6c8082db16 Mon Sep 17 00:00:00 2001 From: Taksh Date: Sat, 29 Aug 2026 18:29:36 +0530 Subject: [PATCH] Raise NIP-17 gift-wrap fetch limit from 100 to 1000 Each delivered-and-read DM is typically three gift wraps, and relays return the newest-by-created_at under the limit. With randomized timestamps, a cap of 100 permanently drops older envelopes inside the lookback (~33 messages). Align with the geohash fetch budget. --- app/src/main/java/com/bitchat/android/nostr/NostrFilter.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/bitchat/android/nostr/NostrFilter.kt b/app/src/main/java/com/bitchat/android/nostr/NostrFilter.kt index df67822f..3f1c54ff 100644 --- a/app/src/main/java/com/bitchat/android/nostr/NostrFilter.kt +++ b/app/src/main/java/com/bitchat/android/nostr/NostrFilter.kt @@ -23,11 +23,15 @@ data class NostrFilter( * Create filter for NIP-17 gift wraps */ fun giftWrapsFor(pubkey: String, since: Long? = null): NostrFilter { + // Each delivered+read DM is typically three gift wraps (message, delivery + // ack, read receipt). A limit of 100 therefore covers only ~33 messages + // inside the lookback, and NIP-01 returns the newest-by-created_at which + // is randomized — so loss is permanent. Match the geohash fetch budget. return NostrFilter( kinds = listOf(NostrKind.GIFT_WRAP), since = since?.let { (it / 1000).toInt() }, tagFilters = mapOf("p" to listOf(pubkey)), - limit = 100 + limit = 1000 ) }