Skip to content

Commit 7c17819

Browse files
committed
stream: Split up asserts in SubscriptionAddEvent handler
I just hit one of these in a new test I was writing, and wanted more information to debug: which of the two conditions failed? I seem to recall hearing a report of this in a non-test context recently, too, but I'm not finding it on a quick search of the tracker or of Zulip.
1 parent 9c50ba5 commit 7c17819

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/model/stream.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,10 +156,10 @@ class StreamStoreImpl with StreamStore {
156156
switch (event) {
157157
case SubscriptionAddEvent():
158158
for (final subscription in event.subscriptions) {
159-
assert(streams.containsKey(subscription.streamId)
160-
&& streams[subscription.streamId] is! Subscription);
161-
assert(streamsByName.containsKey(subscription.name)
162-
&& streamsByName[subscription.name] is! Subscription);
159+
assert(streams.containsKey(subscription.streamId));
160+
assert(streams[subscription.streamId] is! Subscription);
161+
assert(streamsByName.containsKey(subscription.name));
162+
assert(streamsByName[subscription.name] is! Subscription);
163163
assert(!subscriptions.containsKey(subscription.streamId));
164164
streams[subscription.streamId] = subscription;
165165
streamsByName[subscription.name] = subscription;

0 commit comments

Comments
 (0)