Just spent 2 hours fixing the dumbest bug ever. Blocked channel in golang because a select statement wasn't wrapped in a for loop, so it exited after the first match and so anything sending on the channel was blocked.

There must be some name for the phenomenon where the absolute dumbest bugs take the longest to fix.

Reply to this note

Please Login to reply.

Discussion

That was my day yesterday. Spent 2 hours re-deploying nostream to production because I was running `node dist/src/index.ts` instead of `js`

What is a good Go websocket library?

gobwas/ws and nhooyr/websocket depending on your requirements

I tried.

nhooyr is incapable of connecting to many relays because of some gotcha: https://github.com/nbd-wtf/go-nostr/pull/79

gobwas doesn't have support for deflate at all and many relays require that.

Hmm didn’t know about the nhooyr bug, but there exists a wsflate package for gobwas

Indeed, that exists. I tried to plug it in, but I think I failed. There are no docs, the API is weird. https://github.com/nbd-wtf/go-nostr/commit/304b0a0477ee030d757f45fef406d4572e8ccb10

Can you do it? I can put up a bounty.

I still use this most of the time: https://github.com/gorilla/websocket

Otherwise it's C stuff with cgo