@@ -28,7 +28,7 @@ import {
2828 setCursorJournal ,
2929} from './cursor-props' ;
3030import { ChoreBits } from '../vnode/enums/chore-bits.enum' ;
31- import { getHighestPriorityCursor , removeCursorFromQueue } from './cursor-queue' ;
31+ import { addCursorToQueue , getHighestPriorityCursor , removeCursorFromQueue } from './cursor-queue' ;
3232import { executeFlushPhase } from './cursor-flush' ;
3333import { createNextTick } from '../platform/next-tick' ;
3434import { isPromise } from '../utils/promises' ;
@@ -97,11 +97,6 @@ export function walkCursor(cursor: Cursor, options: WalkOptions): void {
9797 const isServer = isServerPlatform ( ) ;
9898 const startTime = performance . now ( ) ;
9999
100- // Check if cursor is already complete
101- if ( ! cursor . dirty ) {
102- return ;
103- }
104-
105100 // Check if cursor is blocked by a promise
106101 const blockingPromise = getVNodePromise ( cursor ) ;
107102 if ( blockingPromise ) {
@@ -111,6 +106,12 @@ export function walkCursor(cursor: Cursor, options: WalkOptions): void {
111106 const container = getCursorContainer ( cursor ) ;
112107 assertDefined ( container , 'Cursor container not found' ) ;
113108
109+ // Check if cursor is already complete
110+ if ( ! cursor . dirty ) {
111+ finishWalk ( container , cursor , isServer ) ;
112+ return ;
113+ }
114+
114115 let journal = getCursorJournal ( cursor ) ;
115116 if ( ! journal ) {
116117 journal = [ ] ;
@@ -188,6 +189,7 @@ export function walkCursor(cursor: Cursor, options: WalkOptions): void {
188189 DEBUG && console . warn ( 'walkCursor: blocking promise' , currentVNode . toString ( ) ) ;
189190 // Store promise on cursor and pause
190191 setVNodePromise ( cursor , result ) ;
192+ removeCursorFromQueue ( cursor ) ;
191193
192194 const host = currentVNode ;
193195 result
@@ -197,6 +199,7 @@ export function walkCursor(cursor: Cursor, options: WalkOptions): void {
197199 } )
198200 . finally ( ( ) => {
199201 setVNodePromise ( cursor , null ) ;
202+ addCursorToQueue ( container , cursor ) ;
200203 triggerCursors ( ) ;
201204 } ) ;
202205 }
0 commit comments