[Flight] Respect displayName of Promise instances on the server#34825
Merged
Conversation
eps1lon
approved these changes
Oct 13, 2025
unstubbable
approved these changes
Oct 13, 2025
| "name": "greeting", | ||
| "start": 0, | ||
| "value": { | ||
| "status": "halted", |
Collaborator
There was a problem hiding this comment.
Wouldn't we expect the value here?
Contributor
Author
There was a problem hiding this comment.
This is an interesting one. Because the promise gets serialized by the props to Component before it has fully resolved, it gives up while serializing it. Later it also is awaited but then it's already serialized as part of props.
Contributor
Author
There was a problem hiding this comment.
Debug channel fixes this ofc.
This was referenced Oct 14, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This lets you assign a name to a Promise that's passed into first party code from third party since it otherwise would have no other stack frame to indicate its name since the whole creation stack would be in third party.
We already respect the
displayNameon the client but it's more complicated on the server because we don't only consider the exact instance passed touse()but the whole await sequence and we can pick any Promise along the way for consideration. Therefore this also adds a change where we pick the Promise node for consideration if it has a name but no stack. Where we otherwise would've picked the I/O node.Another thing that this PR does is treat anonymous stack frames (empty url) as third party for purposes of heuristics like "hasUnfilteredFrame" and the name assignment. This lets you include these in the actual generated stacks (by overriding
filterStackFrame) but we don't actually want them to be considered first party code in the heuristics since it ends up favoring those stacks and using internals likeFunction.allin name assignment.