After the conference, I feel so relieved that I am so productive and into the flow zone.

https://github.com/BlowaterNostr/nostr.ts/pull/52 is finally merged.

Automatic reconnection of disconnected relays is very important for performant and responsive UI.

The testing coverage is also much better. I am aiming for 90%+ for nostr.ts, we will get there.

Reply to this note

Please Login to reply.

Discussion

Testing network code is never easy but doable. The goal of nostr.ts is to become the best relay connection pool & network library in JavaScript ecosystem. Maybe it will implement gossip model and geo connections in the future.

I have wanted to implement auto reconnection in the library since February. I did one experiment, encountered challenges, was mentally lazy, gave up.

Instead I implemented the reconnection in the Blowater app which was convenient at the beginning but problematic in long term.

The lesson is: if something is right and we know it’s right, don’t just give up for small challenges. All challenges seem impossible at first but they all end up being easy.