fiatjaf / noscl

Command line client for Nostr.
Other
269 stars 53 forks source link

Panic on publish #21

Open theRescuer opened 2 years ago

theRescuer commented 2 years ago

Noscl@v0.5.0

Testing a Basic Relay locally I get

/noscl publish https://salvatorelanza.org/2022/01/19/nostr/
panic: concurrent write to websocket connection

goroutine 29 [running]:
github.com/gorilla/websocket.(*messageWriter).flushFrame(0xc000012480, 0x1, {0x0, 0x7fbf7caf4a68, 0x0})
    /home/sal/go/pkg/mod/github.com/gorilla/websocket@v1.4.2/conn.go:610 +0x52b
github.com/gorilla/websocket.(*messageWriter).Close(0x0)
    /home/sal/go/pkg/mod/github.com/gorilla/websocket@v1.4.2/conn.go:724 +0x45
github.com/gorilla/websocket.(*Conn).beginMessage(0xc0000f2160, 0xc0000129c0, 0x1)
    /home/sal/go/pkg/mod/github.com/gorilla/websocket@v1.4.2/conn.go:473 +0x42
github.com/gorilla/websocket.(*Conn).NextWriter(0xc0000f2160, 0x1)
    /home/sal/go/pkg/mod/github.com/gorilla/websocket@v1.4.2/conn.go:513 +0x45
github.com/gorilla/websocket.(*Conn).WriteJSON(0xc00033a040, {0x66d1c0, 0xc00000e138})
    /home/sal/go/pkg/mod/github.com/gorilla/websocket@v1.4.2/json.go:24 +0x45
github.com/fiatjaf/go-nostr.Subscription.Sub({{0xc0004c8070, 0xe}, 0xc000012990, {0xc00032e080, 0x1, 0x1}, 0xc00008e060, 0x0, 0xc00008e0c0})
    /home/sal/go/pkg/mod/github.com/fiatjaf/go-nostr@v0.5.0/subscription.go:49 +0xcd
github.com/fiatjaf/go-nostr.(*RelayPool).Sub(0xc000013980, {0xc00032e080, 0x1, 0x1})
    /home/sal/go/pkg/mod/github.com/fiatjaf/go-nostr@v0.5.0/relaypool.go:197 +0x365
github.com/fiatjaf/go-nostr.(*RelayPool).PublishEvent.func1({0xc00014cee0, 0x1f}, 0x0)
    /home/sal/go/pkg/mod/github.com/fiatjaf/go-nostr@v0.5.0/relaypool.go:236 +0x2ab
created by github.com/fiatjaf/go-nostr.(*RelayPool).PublishEvent
    /home/sal/go/pkg/mod/github.com/fiatjaf/go-nostr@v0.5.0/relaypool.go:228 +0x3f6