Skip to content

ref: Set normalizedRequest instead of request in various places #14305

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
merged 1 commit into from
Nov 20, 2024

Conversation

mydea
Copy link
Member

@mydea mydea commented Nov 14, 2024

The request data integration prefers this over request, we want to get rid of request in v9.

Updates the following:

  • astro/src/server/middleware.ts
  • bun/src/integrations/bunserver.ts
  • cloudflare/src/scope-utils.ts
  • google-cloud-serverless/src/gcpfunction/http.ts
  • nextjs/src/common/captureRequestError.ts
  • nextjs/src/common/withServerActionInstrumentation.ts
  • nextjs/src/common/wrapGenerationFunctionWithSentry.ts
  • nextjs/src/common/wrapMiddlewareWithSentry.ts
  • nextjs/src/common/wrapRouteHandlerWithSentry.ts
  • nextjs/src/common/wrapServerComponentWithSentry.ts
  • nextjs/src/common/pages-router-instrumentation/_error.ts
  • nextjs/src/common/pages-router-instrumentation/wrapApiHandlerWithSentry.ts
  • nextjs/src/common/utils/wrapperUtils.ts
  • nextjs/src/edge/wrapApiHandlerWithSentry.ts
  • remix/src/utils/errors.ts
  • remix/src/utils/instrumentServer.ts
  • sveltekit/src/server/handle.ts

Part of #14298

@mydea mydea self-assigned this Nov 14, 2024
Copy link

codecov bot commented Nov 14, 2024

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
647 1 646 30
View the top 1 failed tests by shortest run time
server-components.test.ts Sends a transaction for a request to app router
Stack Traces | 0.723s run time
server-components.test.ts:4:5 Sends a transaction for a request to app router

To view more test analytics, go to the Test Analytics Dashboard
Got feedback? Let us know on Github

Copy link
Contributor

github-actions bot commented Nov 14, 2024

size-limit report 📦

Path Size % Change Change
@sentry/browser 22.8 KB - -
@sentry/browser - with treeshaking flags 21.57 KB - -
@sentry/browser (incl. Tracing) 35.31 KB - -
@sentry/browser (incl. Tracing, Replay) 72.06 KB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 62.43 KB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 76.35 KB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 88.79 KB - -
@sentry/browser (incl. Feedback) 39.56 KB - -
@sentry/browser (incl. sendFeedback) 27.45 KB - -
@sentry/browser (incl. FeedbackAsync) 32.27 KB - -
@sentry/react 25.58 KB - -
@sentry/react (incl. Tracing) 38.26 KB - -
@sentry/vue 26.95 KB - -
@sentry/vue (incl. Tracing) 37.14 KB - -
@sentry/svelte 22.94 KB - -
CDN Bundle 24.16 KB - -
CDN Bundle (incl. Tracing) 37.11 KB - -
CDN Bundle (incl. Tracing, Replay) 71.78 KB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 77.12 KB - -
CDN Bundle - uncompressed 70.86 KB - -
CDN Bundle (incl. Tracing) - uncompressed 110.07 KB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 222.59 KB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 235.81 KB - -
@sentry/nextjs (client) 38.37 KB - -
@sentry/sveltekit (client) 35.88 KB - -
@sentry/node 134.35 KB -0.04% -48 B 🔽
@sentry/node - without tracing 96.23 KB -0.02% -16 B 🔽
@sentry/aws-serverless 106.52 KB -0.02% -13 B 🔽

View base workflow run

@mydea mydea force-pushed the fn/rewrite-some-request-data branch from ff41cbd to 87316c9 Compare November 15, 2024 08:10
request: {
cookies: {},
headers: expect.any(Object),
url: expect.any(String),
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was actually wrong - previously, when we only had headers on the request, we'd incorrectly infer the url from the origin header. However, since we had nothing else to go on, that would be wrong - because a) it would always use http://, and be the path would be missing, so you'd always get e.g. http://localhost:3000 or http://sentry.io. This change actually "fixes" this by simply not having a URL anymore.

@mydea mydea changed the title ref: Set normalizedRequest instead of request various places ref: Set normalizedRequest instead of request in various places Nov 19, 2024
@mydea mydea force-pushed the fn/rewrite-some-request-data branch from 87316c9 to 2eec3c4 Compare November 19, 2024 15:45
@mydea mydea marked this pull request as ready for review November 19, 2024 15:58
@mydea mydea requested a review from lforst November 19, 2024 15:58
@mydea mydea merged commit 0aadc9b into develop Nov 20, 2024
153 of 155 checks passed
@mydea mydea deleted the fn/rewrite-some-request-data branch November 20, 2024 09:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants