Skip to content

Commit be92ef5

Browse files
committed
channel [nfc]: Add assertions when handling SubscriptionRemoveEvent
1 parent 94cf40e commit be92ef5

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
@@ -304,6 +304,12 @@ class ChannelStoreImpl with ChannelStore {
304304

305305
case SubscriptionRemoveEvent():
306306
for (final streamId in event.streamIds) {
307+
final subscription = streams[streamId];
308+
if (subscription == null || subscription is! Subscription) { // TODO(log)
309+
continue;
310+
}
311+
assert(streamsByName[subscription.name] is Subscription);
312+
assert(subscriptions.containsKey(streamId));
307313
subscriptions.remove(streamId);
308314
}
309315

0 commit comments

Comments
 (0)