Skip to content

Commit

Permalink
fix non-working pub/sub: do not remove non-empty id_to_channels on un…
Browse files Browse the repository at this point in the history
…subscribe
  • Loading branch information
FZambia committed Dec 22, 2021
1 parent 9740f8c commit 83e7688
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion centrifuge.lua
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@ function centrifuge.unsubscribe(id, channels)
if centrifuge.channel_to_ids[v] then
centrifuge.channel_to_ids[v][id] = nil
end
if centrifuge.id_to_channels[id] then
if centrifuge.id_to_channels[id] and next(centrifuge.id_to_channels[id]) == nil then
centrifuge.id_to_channels[id] = nil
end
if centrifuge.channel_to_ids[v] and next(centrifuge.channel_to_ids[v]) == nil then
Expand Down

0 comments on commit 83e7688

Please sign in to comment.