Skip to content

Comments

fix: update nostr-tools and enable native auto-reconnect#516

Open
Dunsin-cyber wants to merge 2 commits intogetAlby:masterfrom
Dunsin-cyber:feat/reconnect-to-relay
Open

fix: update nostr-tools and enable native auto-reconnect#516
Dunsin-cyber wants to merge 2 commits intogetAlby:masterfrom
Dunsin-cyber:feat/reconnect-to-relay

Conversation

@Dunsin-cyber
Copy link
Contributor

Hi @rolznz, Happy New Year! 🎉

I noticed this issue #503 has been open for a couple of months, so I figured I’d take a crack at it to help move things along.

I've put together a fix that moves us away from the manual retry loops and leans into the newer nostr-tools features discussed here nbd-wtf/nostr-tools#513.

What I did:

  • Enabled Native Reconnect: Added enableReconnect: true to the SimplePool in the constructor.
  • Removed Manual Loops: Cleaned out the while retry loops in NWCClient, NWAClient, and NWCWalletService. We now just subscribe once and let the library handle staying connected.
  • Multi-relay support: Updated NWCWalletService to handle an array of relays for better redundancy.
  • Greedy Connection Check: Refactored _checkConnected to use ensureRelay so the SDK actively tries to heal all connections instead of just settling for one.

@socket-security
Copy link

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatednostr-tools@​2.17.0 ⏵ 2.19.497 -2100100 +194 +7100

View full report

@rolznz
Copy link
Contributor

rolznz commented Jan 12, 2026

Thanks @Dunsin-cyber , this is a great improvement I think!

I need to test it heavily and will provide a more detailed review once I have done so. It might take some time to get to this because the current setup "is working" and we are currently doing some more higher impact explorations right now.

@Dunsin-cyber
Copy link
Contributor Author

Thanks @Dunsin-cyber , this is a great improvement I think!

I need to test it heavily and will provide a more detailed review once I have done so. It might take some time to get to this because the current setup "is working" and we are currently doing some more higher impact explorations right now.

Thanks.
Alright. Got it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants