Skip to content

Commit 19defd1

Browse files
committed
Omit end time to indicate that an aborted await didn't complete
1 parent e67b4fe commit 19defd1

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

packages/react-server/src/ReactFlightServer.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2152,7 +2152,11 @@ function visitAsyncNode(
21522152
owner: node.owner,
21532153
stack: filterStackTrace(request, node.stack),
21542154
});
2155-
markOperationEndTime(request, task, endTime);
2155+
// Mark the end time of the await. If we're aborting then we don't emit this
2156+
// to signal that this never resolved inside this render.
2157+
if (request.status !== ABORTING) {
2158+
markOperationEndTime(request, task, endTime);
2159+
}
21562160
}
21572161
}
21582162
}
@@ -2213,7 +2217,12 @@ function emitAsyncSequence(
22132217
}
22142218
}
22152219
emitDebugChunk(request, task.id, debugInfo);
2216-
markOperationEndTime(request, task, awaitedNode.end);
2220+
// Mark the end time of the await. If we're aborting then we don't emit this
2221+
// to signal that this never resolved inside this render.
2222+
if (request.status !== ABORTING) {
2223+
// If we're currently aborting, then this never resolved into user space.
2224+
markOperationEndTime(request, task, awaitedNode.end);
2225+
}
22172226
}
22182227
}
22192228

@@ -4745,7 +4754,6 @@ function forwardDebugInfoFromAbortedTask(request: Request, task: Task): void {
47454754
env: env,
47464755
};
47474756
emitDebugChunk(request, task.id, asyncInfo);
4748-
markOperationEndTime(request, task, performance.now());
47494757
} else {
47504758
emitAsyncSequence(request, task, sequence, debugInfo, null, null);
47514759
}

0 commit comments

Comments
 (0)