fix: resolve im backend issue list regressions

This commit is contained in:
richjohnrambo
2026-09-17 14:59:16 +08:00
parent 760de35e10
commit 50f8581667
13 changed files with 750 additions and 181 deletions
+13 -1
View File
@@ -756,7 +756,7 @@ func (s *Session) subscribe(msg *ClientComMessage) {
// client complete the alias->canonical rename with a 200 reply instead of
// a 304 that would leave the client-side alias topic object unattached
// (publishes on it then fail with "Cannot publish on inactive topic").
if sub := s.getSub(msg.RcptTo); sub != nil && msg.Original == msg.RcptTo {
if sub := s.getSub(msg.RcptTo); sub != nil && canReplyAlreadySubscribed(msg.Original, msg.RcptTo) {
s.queueOut(InfoAlreadySubscribed(msg.Id, msg.Original, msg.Timestamp))
s.inflightReqs.Done()
} else {
@@ -772,6 +772,18 @@ func (s *Session) subscribe(msg *ClientComMessage) {
}
}
func canReplyAlreadySubscribed(original, routeTo string) bool {
if original == routeTo {
return true
}
switch original {
case "me", "fnd", "slf":
return true
default:
return false
}
}
// Leave/Unsubscribe a topic
func (s *Session) leave(msg *ClientComMessage) {
// Expand topic name