Replying to Avatar fiatjaf

nostr:npub1syjmjy0dp62dhccq3g97fr87tngvpvzey08llyt6ul58m2zqpzps9wf6wl there is some bug on https://jumble.social/ that prevents it from requesting notes from wss://lockbox.fiatjaf.com/ in some cases:

See how it tries once, gets an "auth-required:" and authenticates, but then it doesn't try again. Simultaneously the same thing happens with the kind:0 query, but that one is tried again.

Since I put both wss://lockbox.fiatjaf.com and wss://zapbox.fiatjaf.com in the same relay set they're both queried at the same time and for wss://zapbox.fiatjaf.com all seems to work fine, so maybe this is a race condition? I don't know:

There are no errors in the console.

This issue is caused by calling `relay.auth()` twice in quick succession. Since both auth events were signed within the same second, they are identical. Looking at the nostr-tools source code, I found that this prevents the first `relay.auth()` call from ever returning.

I'll find a way to avoid consecutive calls to `relay.auth()`, but it might be better to modify nostr-tools to handle this properly.

https://github.com/nbd-wtf/nostr-tools/blob/9a612e59a254fd2fb54127073051ac47031858d1/abstract-relay.ts#L251

Reply to this note

Please Login to reply.

Discussion

This was a very good catch.

One of these days I'll go back to nostr-tools and fix all the bugs.

Looking forward to your return! This bug is relatively simple, maybe I can create a PR to fix it.