Skip to content

Commit 0a51593

Browse files
committed
Emit start time before an await if one wasn't emitted already
1 parent bb6c9d5 commit 0a51593

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

packages/react-server/src/ReactFlightServer.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2211,6 +2211,10 @@ function emitAsyncSequence(
22112211
debugInfo.stack = filterStackTrace(request, parseStackTrace(stack, 1));
22122212
}
22132213
}
2214+
// We don't have a start time for this await but in case there was no start time emitted
2215+
// we need to include something. TODO: We should maybe ideally track the time when we
2216+
// called .then() but without updating the task.time field since that's used for the cutoff.
2217+
advanceTaskTime(request, task, task.time);
22142218
emitDebugChunk(request, task.id, debugInfo);
22152219
// Mark the end time of the await. If we're aborting then we don't emit this
22162220
// to signal that this never resolved inside this render.
@@ -4752,6 +4756,10 @@ function forwardDebugInfoFromAbortedTask(request: Request, task: Task): void {
47524756
awaited: ((node: any): ReactIOInfo), // This is deduped by this reference.
47534757
env: env,
47544758
};
4759+
// We don't have a start time for this await but in case there was no start time emitted
4760+
// we need to include something. TODO: We should maybe ideally track the time when we
4761+
// called .then() but without updating the task.time field since that's used for the cutoff.
4762+
advanceTaskTime(request, task, task.time);
47554763
emitDebugChunk(request, task.id, asyncInfo);
47564764
} else {
47574765
emitAsyncSequence(request, task, sequence, debugInfo, null, null);

0 commit comments

Comments
 (0)