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.
This commit is contained in:
Taksh 2026-08-29 18:29:36 +05:30
parent 4f828b5643
commit c29d20d5c5

View File

@ -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
)
}