[Flight] Fix stack getting object limited (#33733)

Because the object limit is unfortunately depth first due to limitations
of JSON stringify, we need to ensure that things we really don't want
outlined are first in the enumeration order.

We add the stack length to the object limit to ensure that the stack
frames aren't outlined. In console all the user space arguments are at
the end of the args. In server component props, the props are at the end
of the properties of the element.

For the `value` of I/O we had it before the stack so it could steal the
limit from the stack. The fix is to put it at the end.
This commit is contained in:
Sebastian Markbåge 2025-07-08 12:54:29 -04:00 committed by GitHub
parent befc1246b0
commit 777264b4ef
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -4072,10 +4072,6 @@ function emitIOInfoChunk(
start: relativeStartTimestamp,
end: relativeEndTimestamp,
};
if (value !== undefined) {
// $FlowFixMe[cannot-write]
debugIOInfo.value = value;
}
if (env != null) {
// $FlowFixMe[cannot-write]
debugIOInfo.env = env;
@ -4088,6 +4084,10 @@ function emitIOInfoChunk(
// $FlowFixMe[cannot-write]
debugIOInfo.owner = owner;
}
if (value !== undefined) {
// $FlowFixMe[cannot-write]
debugIOInfo.value = value;
}
const json: string = serializeDebugModel(request, objectLimit, debugIOInfo);
const row = id.toString(16) + ':J' + json + '\n';
const processedChunk = stringToChunk(row);