Skip to content

Commit

Permalink
unreads [nfc]: Add assertions for _addAllInStreamTopic
Browse files Browse the repository at this point in the history
Signed-off-by: Zixuan James Li <zixuan@zulip.com>
  • Loading branch information
PIG208 committed Feb 26, 2025
1 parent b15b974 commit e14008e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/model/unreads.dart
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,8 @@ class Unreads extends ChangeNotifier {

// [messageIds] must be sorted ascending and without duplicates.
void _addAllInStreamTopic(QueueList<int> messageIds, int streamId, TopicName topic) {
assert(messageIds.isNotEmpty);
assert(isSortedWithoutDuplicates(messageIds));
final topics = streams[streamId] ??= {};
topics.update(topic,
ifAbsent: () => messageIds,
Expand Down

0 comments on commit e14008e

Please sign in to comment.