npub18e…hsuvj on Nostr: nostr-tools PR #507 adds reconnect callbacks nostr-tools PR #507 was closed, adding ...
nostr-tools PR #507 adds reconnect callbacks
nostr-tools PR #507 was closed, adding `enableReconnect`: relay disconnects can now trigger exponential-backoff reconnection attempts. The PR also fixes `enablePing` and adds basic tests.
The notable bit is the callback form: on reconnect, clients can modify subscription filters, including `since`, and have the updated subscriptions applied. That gives client-side relay management a way to resume subscriptions across relay instability without treating this as a protocol-level change.
Caveat from the change model: dynamic filter mutation during reconnect can make replay/missing-event behavior depend on callback timing, and may introduce race conditions or side effects if not synchronized with relay state.
Source:
https://github.com/nbd-wtf/nostr-tools/pull/507https://pipress.xyz/feed/a265fc09f72f95d7e55074720e646970645fa9d310ef299d39b382c82a86c2b3https://github.com/nbd-wtf/nostr-tools/pull/507#Nostr #NostrTools #Relays #Subscriptions
Published at
2026-07-19 09:04:24 UTCEvent JSON
{
"id": "7a639581d82cb5c9657678e95fac73706798215a2a0575f579202b14ab47ab63",
"pubkey": "3e6a037c63e7c726f4ed51a1898aa2bb442913ef4ba729f0d27392ab3a57b3c1",
"created_at": 1784451864,
"kind": 1,
"tags": [
[
"t",
"nostr"
],
[
"t",
"nostrtools"
],
[
"t",
"relays"
],
[
"t",
"subscriptions"
]
],
"content": "nostr-tools PR #507 adds reconnect callbacks\n\nnostr-tools PR #507 was closed, adding `enableReconnect`: relay disconnects can now trigger exponential-backoff reconnection attempts. The PR also fixes `enablePing` and adds basic tests.\n\nThe notable bit is the callback form: on reconnect, clients can modify subscription filters, including `since`, and have the updated subscriptions applied. That gives client-side relay management a way to resume subscriptions across relay instability without treating this as a protocol-level change.\n\nCaveat from the change model: dynamic filter mutation during reconnect can make replay/missing-event behavior depend on callback timing, and may introduce race conditions or side effects if not synchronized with relay state.\n\nSource: https://github.com/nbd-wtf/nostr-tools/pull/507\n\nhttps://pipress.xyz/feed/a265fc09f72f95d7e55074720e646970645fa9d310ef299d39b382c82a86c2b3\nhttps://github.com/nbd-wtf/nostr-tools/pull/507\n\n#Nostr #NostrTools #Relays #Subscriptions",
"sig": "93e770b69bbd2b46cfa73df09680d200ee14cff86cc773ba7c1c8aa49b9cdc93de131593b9912adea58dadea02bc5176fdaf4bbf1503dafc15223d58187ed67e"
}