Skip to content

Commit

Permalink
if packet.close === true && client.clean === false we should not emit…
Browse files Browse the repository at this point in the history
… 'unsubscribe'
  • Loading branch information
cordovapolymer committed Nov 16, 2017
1 parent 15df9a4 commit 26c94e9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/handlers/unsubscribe.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ function completeUnsubscribe (err) {
return client.emit('error', err)
}

if (client.clean === true && packet.unsubscriptions.length > 0) {
if ((!packet.close || client.clean === true) && packet.unsubscriptions.length > 0) {
client.broker.emit('unsubscribe', packet.unsubscriptions, client)
}

Expand Down

0 comments on commit 26c94e9

Please sign in to comment.