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>
This commit is contained in:
werben
2024-04-17 00:08:06 +08:00
committed by GitHub
parent cb217cd3b3
commit 21491d9b4e

View File

@@ -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)