Skip to content

Commit

Permalink
fix: added 9 fallback to 8 regarding subsciption parse (#108)
Browse files Browse the repository at this point in the history
  • Loading branch information
reijosirila authored Jan 16, 2023
1 parent f53ed12 commit 6d2d86a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion persistence.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6d2d86a

Please sign in to comment.