events: Remove deactivated streams from subscriptions field.

We did not remove the objects for deactivated streams from
subscriptions field in apply_event. We need to do this because
we do not send "subscription/remove" events to subscribers
when deactivating streams.
This commit is contained in:
Sahil Batra 2023-11-14 17:38:12 +05:30 committed by Tim Abbott
parent 45e1b32447
commit 4f58733d82
1 changed files with 6 additions and 0 deletions

View File

@ -1070,6 +1070,12 @@ def apply_event(
s for s in state["streams"] if s["stream_id"] not in deleted_stream_ids s for s in state["streams"] if s["stream_id"] not in deleted_stream_ids
] ]
state["subscriptions"] = [
stream
for stream in state["subscriptions"]
if stream["stream_id"] not in deleted_stream_ids
]
state["unsubscribed"] = [ state["unsubscribed"] = [
stream stream
for stream in state["unsubscribed"] for stream in state["unsubscribed"]