advance fix

This commit is contained in:
Christien Rioux 2025-05-11 20:07:05 -04:00
parent 2410b63759
commit f6d6b2c86d

View file

@ -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 true if there is more work to do
/// Returns false if there are no more messages to reconcile in this queue
Future<bool> advance() async { Future<bool> advance() async {
final currentMessage = await getCurrentMessage();
if (currentMessage == null) {
return false;
}
// Move current message to previous // Move current message to previous
_previousMessage = _currentMessage; _previousMessage = await getCurrentMessage();
_currentMessage = null; _currentMessage = null;
while (true) { while (true) {
@ -178,7 +175,7 @@ class AuthorInputQueue {
// _inputPosition points to either before the input source starts // _inputPosition points to either before the input source starts
// or the position of the previous element. We still need to set the // 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. // against it if we can.
if (_inputPosition >= 0) { if (_inputPosition >= 0) {
_currentMessage = currentWindow _currentMessage = currentWindow