Skip to content

Commit 779f3ac

Browse files
committed
msglist [nfc]: Assert fetched when updating end markers
This already holds for the existing callers. Updating end markers should only happen after the initial fetch. During the initial fetch, we have a separate loading indicator and no end markers. Signed-off-by: Zixuan James Li <[email protected]>
1 parent 7045afe commit 779f3ac

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lib/model/message_list.dart

+1
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,7 @@ mixin _MessageSequence {
288288

289289
/// Update [items] to include markers at start and end as appropriate.
290290
void _updateEndMarkers() {
291+
assert(fetched);
291292
assert(!(haveOldest && fetchingOlder));
292293
final startMarker = switch ((fetchingOlder, haveOldest)) {
293294
(true, _) => const MessageListLoadingItem(MessageListDirection.older),

0 commit comments

Comments
 (0)