-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
ref: Refactor remaining usage of request
to normalizedRequest
#14401
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
Conversation
@@ -44,6 +52,9 @@ function _wrapHttpFunction(fn: HttpFunction, options: Partial<WrapperOptions>): | |||
const baggage = req.headers?.baggage; | |||
|
|||
return continueTrace({ sentryTrace, baggage }, () => { | |||
const normalizedRequest = httpRequestToRequestEventData(req); |
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.
IMHO it is better to set this before we start the span, so we can 100% ensure this is already set for the span.
|
||
try { | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
normalizedRequest = normalizeRemixRequest(request as unknown as any); | ||
normalizedRequest = winterCGRequestToRequestData(request); |
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.
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...
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.
beautiful
This includes exporting `httpRequestToRequestEventData` from `@sentry/node`, which we can reuse in a few places.
19d5488
to
2323493
Compare
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 |
This includes exporting
httpRequestToRequestEventData
from@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
winterCGRequestToRequestData
instead of the custom implementation we have there. at least type wise, this should all work, let's see if any test complains...Closes #14298