Skip to content

Commit b86acd1

Browse files
make a comment clearer
1 parent 044cb13 commit b86acd1

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

node_package/src/serverRenderReactComponent.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,12 @@ function createFinalResult(
121121
componentName: string,
122122
throwJsErrors: boolean
123123
): null | string | Promise<RenderResult> {
124-
// Node can handle multiple rendering requests simultaneously.
125124
// Console history is stored globally in `console.history`.
126-
// To prevent cross-request data leakage:
127-
// 1. We build the consoleReplayScript here, before any async operations.
128-
// 2. The console history is reset after the sync part of each request.
125+
// If node renderer is handling a render request that returns a promise,
126+
// It can handle another request while awaiting the promise.
127+
// To prevent cross-request console logs leakage between these requests,
128+
// we build the consoleReplayScript before awaiting any promises.
129+
// The console history is reset after the synchronous part of each request.
129130
// This causes console logs happening during async operations to not be captured.
130131
const consoleReplayScript = buildConsoleReplay();
131132

0 commit comments

Comments
 (0)