File tree Expand file tree Collapse file tree 1 file changed +19
-11
lines changed
packages/react-client/src Expand file tree Collapse file tree 1 file changed +19
-11
lines changed Original file line number Diff line number Diff line change @@ -832,27 +832,35 @@ function initializeDebugChunk(
832
832
const debugInfo = chunk . _debugInfo || ( chunk . _debugInfo = [ ] ) ;
833
833
try {
834
834
if ( debugChunk . status === RESOLVED_MODEL ) {
835
+ // Find the index of this debug info by walking the linked list.
836
+ let idx = debugInfo . length ;
837
+ let c = debugChunk . _debugChunk ;
838
+ while ( c !== null ) {
839
+ if ( c . status !== INITIALIZED ) {
840
+ idx ++ ;
841
+ }
842
+ c = c . _debugChunk ;
843
+ }
835
844
// Initializing the model for the first time.
836
845
initializeModelChunk ( debugChunk ) ;
837
846
const initializedChunk = ( ( debugChunk : any ) : SomeChunk < any > ) ;
838
847
switch ( initializedChunk . status ) {
839
848
case INITIALIZED : {
840
- debugInfo . push (
841
- initializeDebugInfo ( response , initializedChunk . value ) ,
849
+ debugInfo [ idx ] = initializeDebugInfo (
850
+ response ,
851
+ initializedChunk . value ,
842
852
) ;
843
853
break ;
844
854
}
845
855
case BLOCKED :
846
856
case PENDING : {
847
- debugInfo . push (
848
- waitForReference (
849
- initializedChunk ,
850
- debugInfo ,
851
- '' + debugInfo . length , // eslint-disable-line react-internal/safe-string-coercion
852
- response ,
853
- initializeDebugInfo ,
854
- [ '' ] , // path
855
- ) ,
857
+ waitForReference (
858
+ initializedChunk ,
859
+ debugInfo ,
860
+ '' + idx ,
861
+ response ,
862
+ initializeDebugInfo ,
863
+ [ '' ] , // path
856
864
) ;
857
865
break ;
858
866
}
You can’t perform that action at this time.
0 commit comments