Skip to content

Commit

Permalink
Delete the newly created task from abortableTasks if it immediately e…
Browse files Browse the repository at this point in the history
…rrors

Otherwise this will be a lingering task which means we might try to abort
it when we close which would log an extra error but we've already errored.
  • Loading branch information
sebmarkbage committed Sep 22, 2023
1 parent e6b39d5 commit 89b4b50
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions packages/react-server/src/ReactFlightServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,7 @@ function serializeThenable(request: Request, thenable: Thenable<any>): number {
},
reason => {
newTask.status = ERRORED;
request.abortableTasks.delete(newTask);
// TODO: We should ideally do this inside performWork so it's scheduled
const digest = logRecoverableError(request, reason);
emitErrorChunk(request, newTask.id, digest, reason);
Expand Down

0 comments on commit 89b4b50

Please sign in to comment.