From f6d6b2c86dca67b38987afcc0072a0e31306f802 Mon Sep 17 00:00:00 2001 From: Christien Rioux Date: Sun, 11 May 2025 20:07:05 -0400 Subject: [PATCH] advance fix --- .../cubits/reconciliation/author_input_queue.dart | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/lib/chat/cubits/reconciliation/author_input_queue.dart b/lib/chat/cubits/reconciliation/author_input_queue.dart index 73dddc6..9a65e82 100644 --- a/lib/chat/cubits/reconciliation/author_input_queue.dart +++ b/lib/chat/cubits/reconciliation/author_input_queue.dart @@ -83,16 +83,13 @@ class AuthorInputQueue { } } - /// Remove a reconciled message and move to the next message + /// Move the reconciliation cursor (_inputPosition) forward on the input + /// queue and tees up the next message for processing /// Returns true if there is more work to do + /// Returns false if there are no more messages to reconcile in this queue Future advance() async { - final currentMessage = await getCurrentMessage(); - if (currentMessage == null) { - return false; - } - // Move current message to previous - _previousMessage = _currentMessage; + _previousMessage = await getCurrentMessage(); _currentMessage = null; while (true) { @@ -178,7 +175,7 @@ class AuthorInputQueue { // _inputPosition points to either before the input source starts // or the position of the previous element. We still need to set the - // _currentMessage to the previous element so consume() can compare + // _currentMessage to the previous element so advance() can compare // against it if we can. if (_inputPosition >= 0) { _currentMessage = currentWindow