ref: Refactor remaining usage of request to normalizedRequest#14401
Merged
ref: Refactor remaining usage of request to normalizedRequest#14401
request to normalizedRequest#14401Conversation
mydea
commented
Nov 21, 2024
| const baggage = req.headers?.baggage; | ||
|
|
||
| return continueTrace({ sentryTrace, baggage }, () => { | ||
| const normalizedRequest = httpRequestToRequestEventData(req); |
Member
Author
There was a problem hiding this comment.
IMHO it is better to set this before we start the span, so we can 100% ensure this is already set for the span.
mydea
commented
Nov 21, 2024
| try { | ||
| // eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
| normalizedRequest = normalizeRemixRequest(request as unknown as any); | ||
| normalizedRequest = winterCGRequestToRequestData(request); |
Member
Author
There was a problem hiding this comment.
I don't really know if we need to try-catch this, I am not confident about how the shape of this is 😅 so I left it like this to be on the safe side...
This includes exporting `httpRequestToRequestEventData` from `@sentry/node`, which we can reuse in a few places.
19d5488 to
2323493
Compare
onurtemizkan
approved these changes
Nov 21, 2024
Contributor
size-limit report 📦
|
❌ 2 Tests Failed:
View the top 2 failed tests by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
3 tasks
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 includes exporting
httpRequestToRequestEventDatafrom@sentry/node, which we can reuse in a few places.This also allows us to remove a bunch of stuff from remix, because actually we can just use
winterCGRequestToRequestDatainstead of the custom implementation we have there. at least type wise, this should all work, let's see if any test complains...Closes #14298