Skip to content

Commit 2fc33aa

Browse files
committed
unreads [nfc]: Add assertions for _addAllInStreamTopic
Signed-off-by: Zixuan James Li <[email protected]>
1 parent ffdf3a8 commit 2fc33aa

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/model/unreads.dart

+2
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,8 @@ class Unreads extends ChangeNotifier {
455455

456456
// [messageIds] must be sorted ascending and without duplicates.
457457
void _addAllInStreamTopic(QueueList<int> messageIds, int streamId, TopicName topic) {
458+
assert(messageIds.isNotEmpty);
459+
assert(isSortedWithoutDuplicates(messageIds));
458460
final topics = streams[streamId] ??= {};
459461
topics.update(topic,
460462
ifAbsent: () => messageIds,

0 commit comments

Comments
 (0)