From 6d2d86a75127a04cb1f2bc8f530145bf8711992f Mon Sep 17 00:00:00 2001 From: reijosirila Date: Mon, 16 Jan 2023 16:48:25 +0200 Subject: [PATCH] fix: added 9 fallback to 8 regarding subsciption parse (#108) --- persistence.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/persistence.js b/persistence.js index d430959..40aa4ed 100644 --- a/persistence.js +++ b/persistence.js @@ -554,7 +554,14 @@ function returnSubsForClient (subs) { } for (const subKey of subKeys) { - toReturn.push(msgpack.decode(subs[subKey])) + if (subs[subKey].length === 1) { // version 8x fallback, QoS saved not encoded object + toReturn.push({ + topic: subKey, + qos: parseInt(subs[subKey]) + }) + } else { + toReturn.push(msgpack.decode(subs[subKey])) + } } return toReturn