Skip to content

Commit b8b58f3

Browse files
committed
channel [nfc]: Add assertions when handling SubscriptionRemoveEvent
1 parent 48d138f commit b8b58f3

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/model/channel.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,12 @@ class ChannelStoreImpl with ChannelStore {
262262

263263
case SubscriptionRemoveEvent():
264264
for (final streamId in event.streamIds) {
265+
final subscription = streams[streamId];
266+
if (subscription == null || subscription is! Subscription) { // TODO(log)
267+
continue;
268+
}
269+
assert(streamsByName[subscription.name] is Subscription);
270+
assert(subscriptions.containsKey(streamId));
265271
subscriptions.remove(streamId);
266272
}
267273

0 commit comments

Comments
 (0)