@@ -4392,6 +4392,14 @@ function erroredTask(
43924392 encodeErrorForBoundary ( boundary , errorDigest , error , errorInfo , false ) ;
43934393 untrackBoundary ( request , boundary ) ;
43944394
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+
43954403 // Regardless of what happens next, this boundary won't be displayed,
43964404 // so we can flush it, if the parent already flushed.
43974405 if ( boundary . parentFlushed ) {
@@ -4544,13 +4552,6 @@ function abortTask(task: Task, request: Request, error: mixed): void {
45444552 segment . status = ABORTED ;
45454553 }
45464554
4547- const row = task . row ;
4548- if ( row !== null ) {
4549- if ( -- row . pendingTasks === 0 ) {
4550- finishSuspenseListRow ( request , row ) ;
4551- }
4552- }
4553-
45544555 const errorInfo = getThrownInfo ( task . componentStack ) ;
45554556
45564557 if ( boundary === null ) {
@@ -4573,7 +4574,7 @@ function abortTask(task: Task, request: Request, error: mixed): void {
45734574 // we just need to mark it as postponed.
45744575 logPostpone ( request , postponeInstance . message , errorInfo , null ) ;
45754576 trackPostpone ( request , trackedPostpones , task , segment ) ;
4576- finishedTask ( request , null , row , segment ) ;
4577+ finishedTask ( request , null , task . row , segment ) ;
45774578 } else {
45784579 const fatal = new Error (
45794580 '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 {
45924593 // We log the error but we still resolve the prerender
45934594 logRecoverableError ( request , error , errorInfo , null ) ;
45944595 trackPostpone ( request , trackedPostpones , task , segment ) ;
4595- finishedTask ( request , null , row , segment ) ;
4596+ finishedTask ( request , null , task . row , segment ) ;
45964597 } else {
45974598 logRecoverableError ( request , error , errorInfo , null ) ;
45984599 fatalError ( request , error , errorInfo , null ) ;
@@ -4636,7 +4637,6 @@ function abortTask(task: Task, request: Request, error: mixed): void {
46364637 }
46374638 }
46384639 } else {
4639- boundary . pendingTasks -- ;
46404640 // We construct an errorInfo from the boundary's componentStack so the error in dev will indicate which
46414641 // boundary the message is referring to
46424642 const trackedPostpones = request . trackedPostpones ;
@@ -4664,7 +4664,7 @@ function abortTask(task: Task, request: Request, error: mixed): void {
46644664 abortTask ( fallbackTask , request , error ) ,
46654665 ) ;
46664666 boundary . fallbackAbortableTasks . clear ( ) ;
4667- return finishedTask ( request , boundary , row , segment ) ;
4667+ return finishedTask ( request , boundary , task . row , segment ) ;
46684668 }
46694669 }
46704670 boundary . status = CLIENT_RENDERED ;
@@ -4681,7 +4681,7 @@ function abortTask(task: Task, request: Request, error: mixed): void {
46814681 logPostpone ( request , postponeInstance . message , errorInfo , null ) ;
46824682 if ( request . trackedPostpones !== null && segment !== null ) {
46834683 trackPostpone ( request , request . trackedPostpones , task , segment ) ;
4684- finishedTask ( request , task . blockedBoundary , row , segment ) ;
4684+ finishedTask ( request , task . blockedBoundary , task . row , segment ) ;
46854685
46864686 // If this boundary was still pending then we haven't already cancelled its fallbacks.
46874687 // 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 {
47064706 }
47074707 }
47084708
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+
47094719 // If this boundary was still pending then we haven't already cancelled its fallbacks.
47104720 // We'll need to abort the fallbacks, which will also error that parent boundary.
47114721 boundary . fallbackAbortableTasks . forEach ( fallbackTask =>
@@ -4714,6 +4724,13 @@ function abortTask(task: Task, request: Request, error: mixed): void {
47144724 boundary . fallbackAbortableTasks . clear ( ) ;
47154725 }
47164726
4727+ const row = task . row ;
4728+ if ( row !== null ) {
4729+ if ( -- row . pendingTasks === 0 ) {
4730+ finishSuspenseListRow ( request , row ) ;
4731+ }
4732+ }
4733+
47174734 request . allPendingTasks -- ;
47184735 if ( request . allPendingTasks === 0 ) {
47194736 completeAll ( request ) ;
0 commit comments