From 3fef0edd7699e908e90f2b32b4e40c9789b5b3d9 Mon Sep 17 00:00:00 2001 From: Neil Twigg Date: Fri, 9 Jun 2023 13:52:26 +0100 Subject: [PATCH] No longer need to manually delete last message on replace Signed-off-by: Neil Twigg --- server/mqtt.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/server/mqtt.go b/server/mqtt.go index b57be5ec..d79a33eb 100644 --- a/server/mqtt.go +++ b/server/mqtt.go @@ -3219,11 +3219,7 @@ func (c *client) mqttHandlePubRetain() { sseq: smr.Sequence, } // Add/update the map - oldSeq := asm.handleRetainedMsg(key, rf) - // If this is a new message on the same subject, delete the old one. - if oldSeq != 0 { - asm.deleteRetainedMsg(oldSeq) - } + asm.handleRetainedMsg(key, rf) } else { c.mu.Lock() acc := c.acc