khatru: OnListenerRemoved wasn't being called in the most common case of a connection dropped.

This commit is contained in:
fiatjaf
2026-05-04 13:13:02 -03:00
parent 61586d5d1b
commit bf7998e780
+5 -1
View File
@@ -349,7 +349,11 @@ func (rl *Relay) removeClientAndListeners(ws *WebSocket) {
if specs, ok := rl.clients[ws]; ok {
for _, spec := range specs {
// no need to cancel contexts since they inherit from the main connection context
rl.dispatcher.removeSubscription(spec.ssid)
filter := rl.dispatcher.removeSubscription(spec.ssid)
if rl.OnListenerRemoved != nil {
rl.OnListenerRemoved(ws, spec.ssid, spec.sid, filter)
}
}
}
delete(rl.clients, ws)