From 21491d9b4e501a78e2bb75c770d141676fc0064d Mon Sep 17 00:00:00 2001 From: werben Date: Wed, 17 Apr 2024 00:08:06 +0800 Subject: [PATCH] Fix the bug where inline subscribers do not receive messages after all non-inline clients unsubscribe. (#386) Co-authored-by: JB <28275108+mochi-co@users.noreply.github.com> --- topics.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/topics.go b/topics.go index 63f704d2..5d599e00 100644 --- a/topics.go +++ b/topics.go @@ -514,7 +514,7 @@ func (x *TopicsIndex) seek(filter string, d int) *particle { // trim removes empty filter particles from the index. func (x *TopicsIndex) trim(n *particle) { - for n.parent != nil && n.retainPath == "" && n.particles.len()+n.subscriptions.Len()+n.shared.Len() == 0 { + for n.parent != nil && n.retainPath == "" && n.particles.len()+n.subscriptions.Len()+n.shared.Len()+n.inlineSubscriptions.Len() == 0 { key := n.key n = n.parent n.particles.delete(key)