Skip to content

Commit

Permalink
fix: subscriptions not read correctly on startup (#100)
Browse files Browse the repository at this point in the history
  • Loading branch information
seriousme authored Jun 13, 2022
1 parent af20fea commit 8448baf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions persistence.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ class RedisPersistence extends CachedPersistence {
const that = this

const hgetallStream = throughv.obj(function getStream (clientId, enc, cb) {
that._db.hgetall(clientSubKey(clientId), function clientHash (err, hash) {
that._db.hgetallBuffer(clientSubKey(clientId), function clientHash (err, hash) {
cb(err, { clientHash: hash, clientId })
})
}, function emitReady (cb) {
Expand Down Expand Up @@ -562,7 +562,7 @@ function returnSubsForClient (subs) {
function processKeysForClient (clientId, clientHash, that) {
const topics = Object.keys(clientHash)
for (const topic of topics) {
const sub = clientHash[topic]
const sub = msgpack.decode(clientHash[topic])
sub.clientId = clientId
that._trie.add(topic, sub)
}
Expand Down

0 comments on commit 8448baf

Please sign in to comment.