nostr:npub1l2vyh47mk2p0qlsku7hg0vn29faehy9hy34ygaclpn66ukqp3afqutajft your relay.nsecbunker.com doesn't reply with OK to ephemeral events, which causes my single-threaded nak bunker to have to wait many seconds for a timeout before it proceeds to process the next RPC request after publishing the previous request, it's horrible UX and I won't fix, you must!

Reply to this note

Please Login to reply.

Discussion

OK

`publishing to wss://relay.nsecbunker.com... failed: context deadline exceeded`

👇

`publishing to wss://relay.nsecbunker.com... success.`

you should consider making it multithreaded tho

i've just bumped up against a bug involving a client not receiving an ok message from the relay (my khatru based relay) and it stalls the NIP-42 protocol and causes the client to time out and die

the common factor every time is that i get a log printing "replaceable event" which i put in there, and clearly the replaceable event code is not sending the ok

guess who wrote the original version i forked from... no, i'll wait

nostr:nprofile1qythwumn8ghj7un9d3shjtnswf5k6ctv9ehx2ap0qy2hwumn8ghj7un9d3shjtnyv9kh2uewd9hj7qgcwaehxw309aex2mrp0yhxxatjwfjkuapwveukjtcqyrafsj7hmweg9ur7zmn6apajdg48hxuskujx53rhrux0ttjcqx84yx35fg2 this is actually a bug in go-nostr

i bet the same thing happens to parameterized ephemeral events too, as they are in the same block

this is my version of the code, i made functions that make the kind range checks more compact

https://github.com/fiatjaf/khatru/blob/master/adding.go#L28

this is the original

the problem is exactly the same, except in my client it didn't expect this disconnection to occur so i hadn't written retry logic to it yet

i'm not absolutely certain on which side the websocket is being closed though, still trying to trace it

i should also point out that i don't get this bug on nostr.wine or eden.nostr.land but i get it from events that my new ingestr tool pulls from relay.primal.net

this is the log of what my relay prints when this happens

1707244734.975199900 trc adding event {"id":"9ea6cc486b289f63f268bc5df29d6dad5a35786822b1e2d1c5739dca38464360","pubkey":"4c800257a588a82849d049817c2bdaad984b25a45ad9f6dad66e47d3b47e3b2f","created_at":1706292659,"kind":10002,"tags":[["r","wss://nostr.wine/","read"],["r","wss://atlas.nostr.land/","read"],["r","wss://eden.nostr.land/","read"],["r","wss://filter.nostr.wine/4c800257a588a82849d049817c2bdaad984b25a45ad9f6dad66e47d3b47e3b2f?broadcast=true","read"],["r","wss://Bevo.nostr1.com/","read"],["r","wss://a.nos.lol/","read"],["r","wss://astral.ninja/","read"],["r","wss://brb.io/","read"],["r","wss://creatr.nostr.wine/","read"],["r","wss://electra.nostr.land/","read"],["r","wss://freespeech.casa/","read"],["r","wss://lightningrelay.com/","read"],["r","wss://nostr.einundzwanzig.space/","read"],["r","wss://translate.nostr.wine/","read"],["client","Coracle","31990:97c70a44366a6535c145b333f973ea86dfdc2d7a99da618c40c64705ad98e322:1685968093690"]],"content":"","sig":"1a40196246876791779bd84ffd3f50c10a5133a6d7272922fe2e3976e21e9de99a8a3717b700fca2e04709973ed054fdda48f0e2c5eee364537d2fbc1e331951"} /replicatr/app/wsprocess.go:114

1707244734.975350556 trc replaceable event /replicatr/app/adding.go:42

this is derived from khatru code, and you can see that the event kind is 10002, which is a replaceable event

so yeah, i'm now dead certain i'm gonna find the problem in the khatru codebase somewhere

my client needs to have retry built into it of course but it was fine with those other two relays but not with primal.net and it sounds like the exact same bug, nip42, not sending an ok to continue and return the message

on the client side there is a problem too, i already added a piece where when it receives an AUTH challenge it sends a signal on a channel (this is in the client code) which then allows me pick up if there is an auth being required... this is from the go-nostr code, the "relay" client code in the root directory

the things haven't been connected together, and there is another one here... gonna spend the next day or so hunting this one and i'll nail it

these two problems i discovered because i tried to build a mirroring tool for events from one relay to another, to a relay that enforces NIP-42 auth for access, which i just got working the day before yesterday

I didn’t write go-nostr 😅

I think that’s another creation of the nostr:npub180cvv07tjdrrgpa0j7j7tmnyl2yr6yr7l8j4s3evf6u64th6gkwsyjh6w6

that's my point, he's the one that raised the issue with you!

you used his code!

you could say that he kicked his own arse with your foot!