-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
fix(start-server-core): h3 2.0.0-beta.5 #5973
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+23
−38
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
Script executed:
Repository: TanStack/router
<shell_result>
Repository: TanStack/router
Exit code: 0
stdout:
</shell_result>
Script executed:
Repository: TanStack/router
<shell_result>
Repository: TanStack/router
Exit code: 0
stdout:
</shell_result>
Script executed:
Repository: TanStack/router
<shell_result>
Repository: TanStack/router
Exit code: 1
</shell_result>
Script executed:
Repository: TanStack/router
<shell_result>
Repository: TanStack/router
Exit code: 0
</shell_result>
Script executed:
Repository: TanStack/router
<shell_result>
Repository: TanStack/router
Exit code: 0
stdout:
</shell_result>
Script executed:
Repository: TanStack/router
<shell_result>
Repository: TanStack/router
Exit code: 0
stdout:
</shell_result>
Script executed:
Repository: TanStack/router
<shell_result>
Repository: TanStack/router
Exit code: 0
stdout:
</shell_result>
Script executed:
Repository: TanStack/router
<shell_result>
Repository: TanStack/router
Exit code: 0
stdout:
</shell_result>
Script executed:
Repository: TanStack/router
<shell_result>
Repository: TanStack/router
Exit code: 0
stdout:
</shell_result>
Script executed:
Repository: TanStack/router
<shell_result>
Repository: TanStack/router
Exit code: 0
stdout:
</shell_result>
Script executed:
Repository: TanStack/router
<shell_result>
Repository: TanStack/router
Exit code: 1
stdout:
</shell_result>
Script executed:
Repository: TanStack/router
<shell_result>
Repository: TanStack/router
Exit code: 0
stdout:
</shell_result>
Script executed:
Repository: TanStack/router
<shell_result>
Repository: TanStack/router
Exit code: 0
stdout:
stderr:
</shell_result>
Script executed:
Repository: TanStack/router
<shell_result>
Repository: TanStack/router
Exit code: 0
stdout:
</shell_result>
h3 H3Event event._res event.res difference h3@2.0.0
<web_search_result>
Short answer: event._res is an internal (implementation) response object used by H3/srvx; event.res is the public "prepared response" API you should use (status, statusText, headers, etc.). In v2 H3 hid/changed internals (event._res and event.res._headers) — don't rely on _res (it's internal/unstable); use event.res and return values instead. [1][2]
Sources:
</web_search_result>
Script executed:
Repository: TanStack/router
<shell_result>
Repository: TanStack/router
Exit code: 0
stdout:
</shell_result>
getResponse()returns an internal h3 property that is not synchronized with where response status is actually written; verifyevent._resis the correct object to return or switch toevent.resThe review concern is valid. The code has an inconsistency:
setResponseStatus()(lines 196–204) writes toevent.res.statusandevent.res.statusTextgetResponse()(line 330) returnsevent._res(a different object)server-functions-handler.ts(lines 186, 224–225, 254–255, 264–265, 302–305) readresponse?.statusandresponse?.statusTextfrom the returned valuePer h3's v2 documentation,
event._resis an internal implementation detail that h3 explicitly hides in v2.x releases, whileevent.resis the public API. SincesetResponseStatus()modifiesevent.res, returningevent._rescreates a synchronization risk where status/statusText values could diverge.Recommendation: Either switch
getResponse()to returnevent.res(the public API where status is actually managed) or add a comment explaining whyevent._resmust be used and verify under h3@2.0.0-beta.4 that both objects stay synchronized.🤖 Prompt for AI Agents