@@ -4392,6 +4392,14 @@ function erroredTask(
4392
4392
encodeErrorForBoundary ( boundary , errorDigest , error , errorInfo , false ) ;
4393
4393
untrackBoundary ( request , boundary ) ;
4394
4394
4395
+ const boundaryRow = boundary . row ;
4396
+ if ( boundaryRow !== null ) {
4397
+ // Unblock the SuspenseListRow that was blocked by this boundary.
4398
+ if ( -- boundaryRow . pendingTasks === 0 ) {
4399
+ finishSuspenseListRow ( request , boundaryRow ) ;
4400
+ }
4401
+ }
4402
+
4395
4403
// Regardless of what happens next, this boundary won't be displayed,
4396
4404
// so we can flush it, if the parent already flushed.
4397
4405
if ( boundary . parentFlushed ) {
@@ -4544,13 +4552,6 @@ function abortTask(task: Task, request: Request, error: mixed): void {
4544
4552
segment . status = ABORTED ;
4545
4553
}
4546
4554
4547
- const row = task . row ;
4548
- if ( row !== null ) {
4549
- if ( -- row . pendingTasks === 0 ) {
4550
- finishSuspenseListRow ( request , row ) ;
4551
- }
4552
- }
4553
-
4554
4555
const errorInfo = getThrownInfo ( task . componentStack ) ;
4555
4556
4556
4557
if ( boundary === null ) {
@@ -4573,7 +4574,7 @@ function abortTask(task: Task, request: Request, error: mixed): void {
4573
4574
// we just need to mark it as postponed.
4574
4575
logPostpone ( request , postponeInstance . message , errorInfo , null ) ;
4575
4576
trackPostpone ( request , trackedPostpones , task , segment ) ;
4576
- finishedTask ( request , null , row , segment ) ;
4577
+ finishedTask ( request , null , task . row , segment ) ;
4577
4578
} else {
4578
4579
const fatal = new Error (
4579
4580
'The render was aborted with postpone when the shell is incomplete. Reason: ' +
@@ -4592,7 +4593,7 @@ function abortTask(task: Task, request: Request, error: mixed): void {
4592
4593
// We log the error but we still resolve the prerender
4593
4594
logRecoverableError ( request , error , errorInfo , null ) ;
4594
4595
trackPostpone ( request , trackedPostpones , task , segment ) ;
4595
- finishedTask ( request , null , row , segment ) ;
4596
+ finishedTask ( request , null , task . row , segment ) ;
4596
4597
} else {
4597
4598
logRecoverableError ( request , error , errorInfo , null ) ;
4598
4599
fatalError ( request , error , errorInfo , null ) ;
@@ -4636,7 +4637,6 @@ function abortTask(task: Task, request: Request, error: mixed): void {
4636
4637
}
4637
4638
}
4638
4639
} else {
4639
- boundary . pendingTasks -- ;
4640
4640
// We construct an errorInfo from the boundary's componentStack so the error in dev will indicate which
4641
4641
// boundary the message is referring to
4642
4642
const trackedPostpones = request . trackedPostpones ;
@@ -4664,7 +4664,7 @@ function abortTask(task: Task, request: Request, error: mixed): void {
4664
4664
abortTask ( fallbackTask , request , error ) ,
4665
4665
) ;
4666
4666
boundary . fallbackAbortableTasks . clear ( ) ;
4667
- return finishedTask ( request , boundary , row , segment ) ;
4667
+ return finishedTask ( request , boundary , task . row , segment ) ;
4668
4668
}
4669
4669
}
4670
4670
boundary . status = CLIENT_RENDERED ;
@@ -4681,7 +4681,7 @@ function abortTask(task: Task, request: Request, error: mixed): void {
4681
4681
logPostpone ( request , postponeInstance . message , errorInfo , null ) ;
4682
4682
if ( request . trackedPostpones !== null && segment !== null ) {
4683
4683
trackPostpone ( request , request . trackedPostpones , task , segment ) ;
4684
- finishedTask ( request , task . blockedBoundary , row , segment ) ;
4684
+ finishedTask ( request , task . blockedBoundary , task . row , segment ) ;
4685
4685
4686
4686
// If this boundary was still pending then we haven't already cancelled its fallbacks.
4687
4687
// We'll need to abort the fallbacks, which will also error that parent boundary.
@@ -4706,6 +4706,16 @@ function abortTask(task: Task, request: Request, error: mixed): void {
4706
4706
}
4707
4707
}
4708
4708
4709
+ boundary . pendingTasks -- ;
4710
+
4711
+ const boundaryRow = boundary . row ;
4712
+ if ( boundaryRow !== null ) {
4713
+ // Unblock the SuspenseListRow that was blocked by this boundary.
4714
+ if ( -- boundaryRow . pendingTasks === 0 ) {
4715
+ finishSuspenseListRow ( request , boundaryRow ) ;
4716
+ }
4717
+ }
4718
+
4709
4719
// If this boundary was still pending then we haven't already cancelled its fallbacks.
4710
4720
// We'll need to abort the fallbacks, which will also error that parent boundary.
4711
4721
boundary . fallbackAbortableTasks . forEach ( fallbackTask =>
@@ -4714,6 +4724,13 @@ function abortTask(task: Task, request: Request, error: mixed): void {
4714
4724
boundary . fallbackAbortableTasks . clear ( ) ;
4715
4725
}
4716
4726
4727
+ const row = task . row ;
4728
+ if ( row !== null ) {
4729
+ if ( -- row . pendingTasks === 0 ) {
4730
+ finishSuspenseListRow ( request , row ) ;
4731
+ }
4732
+ }
4733
+
4717
4734
request . allPendingTasks -- ;
4718
4735
if ( request . allPendingTasks === 0 ) {
4719
4736
completeAll ( request ) ;
0 commit comments