= new Set();
-
const SentryRoutes: React.FC<{
children?: React.ReactNode;
routes: RouteObject[];
@@ -319,7 +350,6 @@ export function handleNavigation(opts: {
allRoutes?: RouteObject[];
}): void {
const { location, routes, navigationType, version, matches, basename, allRoutes } = opts;
-
const branches = Array.isArray(matches) ? matches : _matchRoutes(routes, location, basename);
const client = getClient();
@@ -553,7 +583,7 @@ function updatePageloadTransaction(
): void {
const branches = Array.isArray(matches)
? matches
- : (_matchRoutes(routes, location, basename) as unknown as RouteMatch[]);
+ : (_matchRoutes(allRoutes || routes, location, basename) as unknown as RouteMatch[]);
if (branches) {
let name,
@@ -569,7 +599,7 @@ function updatePageloadTransaction(
[name, source] = getNormalizedName(routes, location, branches, basename);
}
- getCurrentScope().setTransactionName(name);
+ getCurrentScope().setTransactionName(name || '/');
if (activeRootSpan) {
activeRootSpan.updateName(name);
@@ -592,8 +622,6 @@ export function createV6CompatibleWithSentryReactRouterRouting = new Set();
-
const SentryRoutes: React.FC
= (props: P) => {
const isMountRenderPass = React.useRef(true);
diff --git a/packages/react/src/types.ts b/packages/react/src/types.ts
index 1a40ec4fce91..b29a2dbd1cad 100644
--- a/packages/react/src/types.ts
+++ b/packages/react/src/types.ts
@@ -182,10 +182,14 @@ export interface RouterInit {
hydrationData?: HydrationState;
}
+export type NavigationState = {
+ state: 'idle' | 'loading' | 'submitting';
+};
+
export type NavigationStates = {
- Idle: any;
- Loading: any;
- Submitting: any;
+ Idle: NavigationState;
+ Loading: NavigationState;
+ Submitting: NavigationState;
};
export type Navigation = NavigationStates[keyof NavigationStates];
@@ -202,6 +206,7 @@ export declare enum HistoryAction {
export interface RouterState {
historyAction: Action | HistoryAction | any;
location: Location;
+ navigation: Navigation;
}
export interface Router {
state: TState;
From 1b68b7f17b71e80705f052d1002daec7dfb124f0 Mon Sep 17 00:00:00 2001
From: Philipp Hofmann
Date: Thu, 23 Jan 2025 11:07:05 +0100
Subject: [PATCH 05/43] Remove date range for LICENSEs
In our internal Open Source Legal Policy, we decided that licenses don't
require a data range. This also has the advantage of not updating the
date range yearly.
---
LICENSE | 2 +-
packages/angular/LICENSE | 2 +-
packages/astro/LICENSE | 2 +-
packages/aws-serverless/LICENSE | 2 +-
packages/browser-utils/LICENSE | 2 +-
packages/browser/LICENSE | 2 +-
packages/bun/LICENSE | 2 +-
packages/cloudflare/LICENSE | 2 +-
packages/core/LICENSE | 2 +-
packages/deno/LICENSE | 2 +-
packages/ember/LICENSE | 2 +-
packages/eslint-config-sdk/LICENSE | 2 +-
packages/eslint-plugin-sdk/LICENSE | 2 +-
packages/feedback/LICENSE | 2 +-
packages/gatsby/LICENSE | 2 +-
packages/google-cloud-serverless/LICENSE | 2 +-
packages/integration-shims/LICENSE | 2 +-
packages/nestjs/LICENSE | 2 +-
packages/nextjs/LICENSE | 2 +-
packages/node/LICENSE | 2 +-
packages/nuxt/LICENSE | 2 +-
packages/opentelemetry/LICENSE | 2 +-
packages/profiling-node/LICENSE | 2 +-
packages/react/LICENSE | 2 +-
packages/remix/LICENSE | 2 +-
packages/replay-canvas/LICENSE | 2 +-
packages/replay-internal/LICENSE | 2 +-
packages/replay-worker/LICENSE | 2 +-
packages/solid/LICENSE | 2 +-
packages/solidstart/LICENSE | 2 +-
packages/svelte/LICENSE | 2 +-
packages/sveltekit/LICENSE | 2 +-
packages/types/LICENSE | 2 +-
packages/typescript/LICENSE | 2 +-
packages/vercel-edge/LICENSE | 2 +-
packages/vue/LICENSE | 2 +-
packages/wasm/LICENSE | 2 +-
37 files changed, 37 insertions(+), 37 deletions(-)
diff --git a/LICENSE b/LICENSE
index 98482f33b3be..84d8d8c065fc 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,6 +1,6 @@
MIT License
-Copyright (c) 2012-2025 Functional Software, Inc. dba Sentry
+Copyright (c) 2012 Functional Software, Inc. dba Sentry
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
diff --git a/packages/angular/LICENSE b/packages/angular/LICENSE
index 9739499d2513..63e7eb28e19c 100644
--- a/packages/angular/LICENSE
+++ b/packages/angular/LICENSE
@@ -1,6 +1,6 @@
MIT License
-Copyright (c) 2024-2025 Functional Software, Inc. dba Sentry
+Copyright (c) 2024 Functional Software, Inc. dba Sentry
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
diff --git a/packages/astro/LICENSE b/packages/astro/LICENSE
index eaf96aacc0c8..b3c4b18a6317 100644
--- a/packages/astro/LICENSE
+++ b/packages/astro/LICENSE
@@ -1,6 +1,6 @@
MIT License
-Copyright (c) 2023-2025 Functional Software, Inc. dba Sentry
+Copyright (c) 2023 Functional Software, Inc. dba Sentry
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
diff --git a/packages/aws-serverless/LICENSE b/packages/aws-serverless/LICENSE
index 58ef1814e188..b956a1944c7b 100644
--- a/packages/aws-serverless/LICENSE
+++ b/packages/aws-serverless/LICENSE
@@ -1,6 +1,6 @@
MIT License
-Copyright (c) 2020-2025 Functional Software, Inc. dba Sentry
+Copyright (c) 2020 Functional Software, Inc. dba Sentry
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
diff --git a/packages/browser-utils/LICENSE b/packages/browser-utils/LICENSE
index 58ef1814e188..b956a1944c7b 100644
--- a/packages/browser-utils/LICENSE
+++ b/packages/browser-utils/LICENSE
@@ -1,6 +1,6 @@
MIT License
-Copyright (c) 2020-2025 Functional Software, Inc. dba Sentry
+Copyright (c) 2020 Functional Software, Inc. dba Sentry
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
diff --git a/packages/browser/LICENSE b/packages/browser/LICENSE
index 9440728b1ced..9f2152e89993 100644
--- a/packages/browser/LICENSE
+++ b/packages/browser/LICENSE
@@ -1,6 +1,6 @@
MIT License
-Copyright (c) 2019-2025 Functional Software, Inc. dba Sentry
+Copyright (c) 2019 Functional Software, Inc. dba Sentry
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
diff --git a/packages/bun/LICENSE b/packages/bun/LICENSE
index eaf96aacc0c8..b3c4b18a6317 100644
--- a/packages/bun/LICENSE
+++ b/packages/bun/LICENSE
@@ -1,6 +1,6 @@
MIT License
-Copyright (c) 2023-2025 Functional Software, Inc. dba Sentry
+Copyright (c) 2023 Functional Software, Inc. dba Sentry
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
diff --git a/packages/cloudflare/LICENSE b/packages/cloudflare/LICENSE
index 9739499d2513..63e7eb28e19c 100644
--- a/packages/cloudflare/LICENSE
+++ b/packages/cloudflare/LICENSE
@@ -1,6 +1,6 @@
MIT License
-Copyright (c) 2024-2025 Functional Software, Inc. dba Sentry
+Copyright (c) 2024 Functional Software, Inc. dba Sentry
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
diff --git a/packages/core/LICENSE b/packages/core/LICENSE
index 9440728b1ced..9f2152e89993 100644
--- a/packages/core/LICENSE
+++ b/packages/core/LICENSE
@@ -1,6 +1,6 @@
MIT License
-Copyright (c) 2019-2025 Functional Software, Inc. dba Sentry
+Copyright (c) 2019 Functional Software, Inc. dba Sentry
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
diff --git a/packages/deno/LICENSE b/packages/deno/LICENSE
index eaf96aacc0c8..b3c4b18a6317 100644
--- a/packages/deno/LICENSE
+++ b/packages/deno/LICENSE
@@ -1,6 +1,6 @@
MIT License
-Copyright (c) 2023-2025 Functional Software, Inc. dba Sentry
+Copyright (c) 2023 Functional Software, Inc. dba Sentry
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
diff --git a/packages/ember/LICENSE b/packages/ember/LICENSE
index 58ef1814e188..b956a1944c7b 100644
--- a/packages/ember/LICENSE
+++ b/packages/ember/LICENSE
@@ -1,6 +1,6 @@
MIT License
-Copyright (c) 2020-2025 Functional Software, Inc. dba Sentry
+Copyright (c) 2020 Functional Software, Inc. dba Sentry
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
diff --git a/packages/eslint-config-sdk/LICENSE b/packages/eslint-config-sdk/LICENSE
index 58ef1814e188..b956a1944c7b 100644
--- a/packages/eslint-config-sdk/LICENSE
+++ b/packages/eslint-config-sdk/LICENSE
@@ -1,6 +1,6 @@
MIT License
-Copyright (c) 2020-2025 Functional Software, Inc. dba Sentry
+Copyright (c) 2020 Functional Software, Inc. dba Sentry
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
diff --git a/packages/eslint-plugin-sdk/LICENSE b/packages/eslint-plugin-sdk/LICENSE
index 58ef1814e188..b956a1944c7b 100644
--- a/packages/eslint-plugin-sdk/LICENSE
+++ b/packages/eslint-plugin-sdk/LICENSE
@@ -1,6 +1,6 @@
MIT License
-Copyright (c) 2020-2025 Functional Software, Inc. dba Sentry
+Copyright (c) 2020 Functional Software, Inc. dba Sentry
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
diff --git a/packages/feedback/LICENSE b/packages/feedback/LICENSE
index eaf96aacc0c8..b3c4b18a6317 100644
--- a/packages/feedback/LICENSE
+++ b/packages/feedback/LICENSE
@@ -1,6 +1,6 @@
MIT License
-Copyright (c) 2023-2025 Functional Software, Inc. dba Sentry
+Copyright (c) 2023 Functional Software, Inc. dba Sentry
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
diff --git a/packages/gatsby/LICENSE b/packages/gatsby/LICENSE
index 58ef1814e188..b956a1944c7b 100644
--- a/packages/gatsby/LICENSE
+++ b/packages/gatsby/LICENSE
@@ -1,6 +1,6 @@
MIT License
-Copyright (c) 2020-2025 Functional Software, Inc. dba Sentry
+Copyright (c) 2020 Functional Software, Inc. dba Sentry
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
diff --git a/packages/google-cloud-serverless/LICENSE b/packages/google-cloud-serverless/LICENSE
index 9739499d2513..63e7eb28e19c 100644
--- a/packages/google-cloud-serverless/LICENSE
+++ b/packages/google-cloud-serverless/LICENSE
@@ -1,6 +1,6 @@
MIT License
-Copyright (c) 2024-2025 Functional Software, Inc. dba Sentry
+Copyright (c) 2024 Functional Software, Inc. dba Sentry
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
diff --git a/packages/integration-shims/LICENSE b/packages/integration-shims/LICENSE
index eaf96aacc0c8..b3c4b18a6317 100644
--- a/packages/integration-shims/LICENSE
+++ b/packages/integration-shims/LICENSE
@@ -1,6 +1,6 @@
MIT License
-Copyright (c) 2023-2025 Functional Software, Inc. dba Sentry
+Copyright (c) 2023 Functional Software, Inc. dba Sentry
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
diff --git a/packages/nestjs/LICENSE b/packages/nestjs/LICENSE
index 9739499d2513..63e7eb28e19c 100644
--- a/packages/nestjs/LICENSE
+++ b/packages/nestjs/LICENSE
@@ -1,6 +1,6 @@
MIT License
-Copyright (c) 2024-2025 Functional Software, Inc. dba Sentry
+Copyright (c) 2024 Functional Software, Inc. dba Sentry
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
diff --git a/packages/nextjs/LICENSE b/packages/nextjs/LICENSE
index 6d1ad17eb71b..917e31f85b7a 100644
--- a/packages/nextjs/LICENSE
+++ b/packages/nextjs/LICENSE
@@ -1,6 +1,6 @@
MIT License
-Copyright (c) 2021-2025 Functional Software, Inc. dba Sentry
+Copyright (c) 2021 Functional Software, Inc. dba Sentry
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
diff --git a/packages/node/LICENSE b/packages/node/LICENSE
index eaf96aacc0c8..b3c4b18a6317 100644
--- a/packages/node/LICENSE
+++ b/packages/node/LICENSE
@@ -1,6 +1,6 @@
MIT License
-Copyright (c) 2023-2025 Functional Software, Inc. dba Sentry
+Copyright (c) 2023 Functional Software, Inc. dba Sentry
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
diff --git a/packages/nuxt/LICENSE b/packages/nuxt/LICENSE
index eaf96aacc0c8..b3c4b18a6317 100644
--- a/packages/nuxt/LICENSE
+++ b/packages/nuxt/LICENSE
@@ -1,6 +1,6 @@
MIT License
-Copyright (c) 2023-2025 Functional Software, Inc. dba Sentry
+Copyright (c) 2023 Functional Software, Inc. dba Sentry
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
diff --git a/packages/opentelemetry/LICENSE b/packages/opentelemetry/LICENSE
index eaf96aacc0c8..b3c4b18a6317 100644
--- a/packages/opentelemetry/LICENSE
+++ b/packages/opentelemetry/LICENSE
@@ -1,6 +1,6 @@
MIT License
-Copyright (c) 2023-2025 Functional Software, Inc. dba Sentry
+Copyright (c) 2023 Functional Software, Inc. dba Sentry
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
diff --git a/packages/profiling-node/LICENSE b/packages/profiling-node/LICENSE
index a69d859b8939..293314012679 100644
--- a/packages/profiling-node/LICENSE
+++ b/packages/profiling-node/LICENSE
@@ -1,6 +1,6 @@
MIT License
-Copyright (c) 2022-2025 Functional Software, Inc. dba Sentry
+Copyright (c) 2022 Functional Software, Inc. dba Sentry
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
diff --git a/packages/react/LICENSE b/packages/react/LICENSE
index 9440728b1ced..9f2152e89993 100644
--- a/packages/react/LICENSE
+++ b/packages/react/LICENSE
@@ -1,6 +1,6 @@
MIT License
-Copyright (c) 2019-2025 Functional Software, Inc. dba Sentry
+Copyright (c) 2019 Functional Software, Inc. dba Sentry
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
diff --git a/packages/remix/LICENSE b/packages/remix/LICENSE
index a69d859b8939..293314012679 100644
--- a/packages/remix/LICENSE
+++ b/packages/remix/LICENSE
@@ -1,6 +1,6 @@
MIT License
-Copyright (c) 2022-2025 Functional Software, Inc. dba Sentry
+Copyright (c) 2022 Functional Software, Inc. dba Sentry
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
diff --git a/packages/replay-canvas/LICENSE b/packages/replay-canvas/LICENSE
index 9739499d2513..63e7eb28e19c 100644
--- a/packages/replay-canvas/LICENSE
+++ b/packages/replay-canvas/LICENSE
@@ -1,6 +1,6 @@
MIT License
-Copyright (c) 2024-2025 Functional Software, Inc. dba Sentry
+Copyright (c) 2024 Functional Software, Inc. dba Sentry
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
diff --git a/packages/replay-internal/LICENSE b/packages/replay-internal/LICENSE
index a69d859b8939..293314012679 100644
--- a/packages/replay-internal/LICENSE
+++ b/packages/replay-internal/LICENSE
@@ -1,6 +1,6 @@
MIT License
-Copyright (c) 2022-2025 Functional Software, Inc. dba Sentry
+Copyright (c) 2022 Functional Software, Inc. dba Sentry
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
diff --git a/packages/replay-worker/LICENSE b/packages/replay-worker/LICENSE
index eaf96aacc0c8..b3c4b18a6317 100644
--- a/packages/replay-worker/LICENSE
+++ b/packages/replay-worker/LICENSE
@@ -1,6 +1,6 @@
MIT License
-Copyright (c) 2023-2025 Functional Software, Inc. dba Sentry
+Copyright (c) 2023 Functional Software, Inc. dba Sentry
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
diff --git a/packages/solid/LICENSE b/packages/solid/LICENSE
index 9739499d2513..63e7eb28e19c 100644
--- a/packages/solid/LICENSE
+++ b/packages/solid/LICENSE
@@ -1,6 +1,6 @@
MIT License
-Copyright (c) 2024-2025 Functional Software, Inc. dba Sentry
+Copyright (c) 2024 Functional Software, Inc. dba Sentry
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
diff --git a/packages/solidstart/LICENSE b/packages/solidstart/LICENSE
index 9739499d2513..63e7eb28e19c 100644
--- a/packages/solidstart/LICENSE
+++ b/packages/solidstart/LICENSE
@@ -1,6 +1,6 @@
MIT License
-Copyright (c) 2024-2025 Functional Software, Inc. dba Sentry
+Copyright (c) 2024 Functional Software, Inc. dba Sentry
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
diff --git a/packages/svelte/LICENSE b/packages/svelte/LICENSE
index a69d859b8939..293314012679 100644
--- a/packages/svelte/LICENSE
+++ b/packages/svelte/LICENSE
@@ -1,6 +1,6 @@
MIT License
-Copyright (c) 2022-2025 Functional Software, Inc. dba Sentry
+Copyright (c) 2022 Functional Software, Inc. dba Sentry
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
diff --git a/packages/sveltekit/LICENSE b/packages/sveltekit/LICENSE
index eaf96aacc0c8..b3c4b18a6317 100644
--- a/packages/sveltekit/LICENSE
+++ b/packages/sveltekit/LICENSE
@@ -1,6 +1,6 @@
MIT License
-Copyright (c) 2023-2025 Functional Software, Inc. dba Sentry
+Copyright (c) 2023 Functional Software, Inc. dba Sentry
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
diff --git a/packages/types/LICENSE b/packages/types/LICENSE
index 9440728b1ced..9f2152e89993 100644
--- a/packages/types/LICENSE
+++ b/packages/types/LICENSE
@@ -1,6 +1,6 @@
MIT License
-Copyright (c) 2019-2025 Functional Software, Inc. dba Sentry
+Copyright (c) 2019 Functional Software, Inc. dba Sentry
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
diff --git a/packages/typescript/LICENSE b/packages/typescript/LICENSE
index 9440728b1ced..9f2152e89993 100644
--- a/packages/typescript/LICENSE
+++ b/packages/typescript/LICENSE
@@ -1,6 +1,6 @@
MIT License
-Copyright (c) 2019-2025 Functional Software, Inc. dba Sentry
+Copyright (c) 2019 Functional Software, Inc. dba Sentry
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
diff --git a/packages/vercel-edge/LICENSE b/packages/vercel-edge/LICENSE
index eaf96aacc0c8..b3c4b18a6317 100644
--- a/packages/vercel-edge/LICENSE
+++ b/packages/vercel-edge/LICENSE
@@ -1,6 +1,6 @@
MIT License
-Copyright (c) 2023-2025 Functional Software, Inc. dba Sentry
+Copyright (c) 2023 Functional Software, Inc. dba Sentry
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
diff --git a/packages/vue/LICENSE b/packages/vue/LICENSE
index 9440728b1ced..9f2152e89993 100644
--- a/packages/vue/LICENSE
+++ b/packages/vue/LICENSE
@@ -1,6 +1,6 @@
MIT License
-Copyright (c) 2019-2025 Functional Software, Inc. dba Sentry
+Copyright (c) 2019 Functional Software, Inc. dba Sentry
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
diff --git a/packages/wasm/LICENSE b/packages/wasm/LICENSE
index 6d1ad17eb71b..917e31f85b7a 100644
--- a/packages/wasm/LICENSE
+++ b/packages/wasm/LICENSE
@@ -1,6 +1,6 @@
MIT License
-Copyright (c) 2021-2025 Functional Software, Inc. dba Sentry
+Copyright (c) 2021 Functional Software, Inc. dba Sentry
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
From d789766b6fcdc468819ba25b18c557c8232d1ed6 Mon Sep 17 00:00:00 2001
From: Tim Fish
Date: Thu, 23 Jan 2025 15:33:22 +0100
Subject: [PATCH 06/43] fix(node): Missing `release` from ANR sessions (#15138)
---
.../node-integration-tests/suites/anr/basic-session.js | 2 +-
dev-packages/node-integration-tests/suites/anr/test.ts | 3 +++
packages/node/src/integrations/anr/worker.ts | 8 +++++++-
3 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/dev-packages/node-integration-tests/suites/anr/basic-session.js b/dev-packages/node-integration-tests/suites/anr/basic-session.js
index 9700131a6040..7971d547c884 100644
--- a/dev-packages/node-integration-tests/suites/anr/basic-session.js
+++ b/dev-packages/node-integration-tests/suites/anr/basic-session.js
@@ -9,7 +9,7 @@ setTimeout(() => {
Sentry.init({
dsn: process.env.SENTRY_DSN,
- release: '1.0',
+ release: '1.0.0',
integrations: [Sentry.anrIntegration({ captureStackTrace: true, anrThreshold: 100 })],
});
diff --git a/dev-packages/node-integration-tests/suites/anr/test.ts b/dev-packages/node-integration-tests/suites/anr/test.ts
index ec980f07f123..9a91d4f205c6 100644
--- a/dev-packages/node-integration-tests/suites/anr/test.ts
+++ b/dev-packages/node-integration-tests/suites/anr/test.ts
@@ -188,6 +188,9 @@ describe('should report ANR when event loop blocked', () => {
session: {
status: 'abnormal',
abnormal_mechanism: 'anr_foreground',
+ attrs: {
+ release: '1.0.0',
+ },
},
})
.expect({ event: ANR_EVENT_WITH_SCOPE })
diff --git a/packages/node/src/integrations/anr/worker.ts b/packages/node/src/integrations/anr/worker.ts
index 8900b423710b..2eebfe40309b 100644
--- a/packages/node/src/integrations/anr/worker.ts
+++ b/packages/node/src/integrations/anr/worker.ts
@@ -46,7 +46,13 @@ async function sendAbnormalSession(): Promise {
// of we have an existing session passed from the main thread, send it as abnormal
if (session) {
log('Sending abnormal session');
- updateSession(session, { status: 'abnormal', abnormal_mechanism: 'anr_foreground' });
+
+ updateSession(session, {
+ status: 'abnormal',
+ abnormal_mechanism: 'anr_foreground',
+ release: options.release,
+ environment: options.environment,
+ });
const envelope = createSessionEnvelope(session, options.dsn, options.sdkMetadata, options.tunnel);
// Log the envelope so to aid in testing
From 9622bba15719fa82e5b4b6863297cd01337e4525 Mon Sep 17 00:00:00 2001
From: Abhijeet Prasad
Date: Thu, 23 Jan 2025 09:33:50 -0500
Subject: [PATCH 07/43] feat(core): Add client outcomes for breadcrumbs buffer
(#15082)
ref https://github.com/getsentry/team-sdks/issues/116
This PR implements a new client discard reason for `buffer_overflow`.
This will be used to track when the internal breadcrumbs buffer
overflows for the new logs product that we are working on. This is
documented in develop here:
https://github.com/getsentry/sentry-docs/pull/12395
Note: The reason we have `buffer_overflow` as a separate item to
`queue_overflow` is that in the future when we send log items in
envelopes we'll increment `queue_overflow` for the transport queue. We
want to differentiate between the transport queue and the internal
buffer explicitly.
---
packages/core/src/scope.ts | 8 +++++---
packages/core/src/types-hoist/clientreport.ts | 3 ++-
packages/core/src/types-hoist/datacategory.ts | 6 +++++-
packages/core/test/lib/client.test.ts | 16 ++++++++++++++++
4 files changed, 28 insertions(+), 5 deletions(-)
diff --git a/packages/core/src/scope.ts b/packages/core/src/scope.ts
index ce559d589fe3..a302e5a14c34 100644
--- a/packages/core/src/scope.ts
+++ b/packages/core/src/scope.ts
@@ -479,9 +479,11 @@ export class Scope {
...breadcrumb,
};
- const breadcrumbs = this._breadcrumbs;
- breadcrumbs.push(mergedBreadcrumb);
- this._breadcrumbs = breadcrumbs.length > maxCrumbs ? breadcrumbs.slice(-maxCrumbs) : breadcrumbs;
+ this._breadcrumbs.push(mergedBreadcrumb);
+ if (this._breadcrumbs.length > maxCrumbs) {
+ this._breadcrumbs = this._breadcrumbs.slice(-maxCrumbs);
+ this._client?.recordDroppedEvent('buffer_overflow', 'log_item');
+ }
this._notifyScopeListeners();
diff --git a/packages/core/src/types-hoist/clientreport.ts b/packages/core/src/types-hoist/clientreport.ts
index b6ab1766e68c..069adec43c62 100644
--- a/packages/core/src/types-hoist/clientreport.ts
+++ b/packages/core/src/types-hoist/clientreport.ts
@@ -8,7 +8,8 @@ export type EventDropReason =
| 'ratelimit_backoff'
| 'sample_rate'
| 'send_error'
- | 'internal_sdk_error';
+ | 'internal_sdk_error'
+ | 'buffer_overflow';
export type Outcome = {
reason: EventDropReason;
diff --git a/packages/core/src/types-hoist/datacategory.ts b/packages/core/src/types-hoist/datacategory.ts
index da90cc0ca90b..2e636b605fcf 100644
--- a/packages/core/src/types-hoist/datacategory.ts
+++ b/packages/core/src/types-hoist/datacategory.ts
@@ -14,7 +14,7 @@ export type DataCategory =
| 'replay'
// Events with `event_type` csp, hpkp, expectct, expectstaple
| 'security'
- // Attachment bytes stored (unused for rate limiting
+ // Attachment bytes stored (unused for rate limiting)
| 'attachment'
// Session update events
| 'session'
@@ -28,5 +28,9 @@ export type DataCategory =
| 'feedback'
// Span
| 'span'
+ // Log event
+ | 'log_item'
+ // Log bytes stored (unused for rate limiting)
+ | 'log_byte'
// Unknown data category
| 'unknown';
diff --git a/packages/core/test/lib/client.test.ts b/packages/core/test/lib/client.test.ts
index 19a10f7f509a..c415f1ceb411 100644
--- a/packages/core/test/lib/client.test.ts
+++ b/packages/core/test/lib/client.test.ts
@@ -164,6 +164,22 @@ describe('Client', () => {
expect(isolationScopeBreadcrumbs).toEqual([{ message: 'hello3', timestamp: expect.any(Number) }]);
});
+ test('it records `buffer_overflow` client discard reason when buffer overflows', () => {
+ const options = getDefaultTestClientOptions({ maxBreadcrumbs: 1 });
+ const client = new TestClient(options);
+ const recordLostEventSpy = jest.spyOn(client, 'recordDroppedEvent');
+ setCurrentClient(client);
+ getIsolationScope().setClient(client);
+ client.init();
+
+ addBreadcrumb({ message: 'hello1' });
+ addBreadcrumb({ message: 'hello2' });
+ addBreadcrumb({ message: 'hello3' });
+
+ expect(recordLostEventSpy).toHaveBeenCalledTimes(2);
+ expect(recordLostEventSpy).toHaveBeenLastCalledWith('buffer_overflow', 'log_item');
+ });
+
test('calls `beforeBreadcrumb` and adds the breadcrumb without any changes', () => {
const beforeBreadcrumb = jest.fn(breadcrumb => breadcrumb);
const options = getDefaultTestClientOptions({ beforeBreadcrumb });
From ad5418d67ba4ef28c359cecf97bc70eafc71d40a Mon Sep 17 00:00:00 2001
From: Luca Forstner
Date: Thu, 23 Jan 2025 16:04:05 +0100
Subject: [PATCH 08/43] fix(nextjs): Flush with `waitUntil` in
`captureRequestError` (#15146)
---
packages/nextjs/src/common/captureRequestError.ts | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/packages/nextjs/src/common/captureRequestError.ts b/packages/nextjs/src/common/captureRequestError.ts
index 26fdaab4953b..c872d70f8334 100644
--- a/packages/nextjs/src/common/captureRequestError.ts
+++ b/packages/nextjs/src/common/captureRequestError.ts
@@ -1,5 +1,7 @@
import type { RequestEventData } from '@sentry/core';
+import { vercelWaitUntil } from '@sentry/core';
import { captureException, headersToDict, withScope } from '@sentry/core';
+import { flushSafelyWithTimeout } from './utils/responseEnd';
type RequestInfo = {
path: string;
@@ -39,5 +41,7 @@ export function captureRequestError(error: unknown, request: RequestInfo, errorC
handled: false,
},
});
+
+ vercelWaitUntil(flushSafelyWithTimeout());
});
}
From 6b66a2844a5dc95249e789e2139246c639158e0f Mon Sep 17 00:00:00 2001
From: Sigrid Huemer <32902192+s1gr1d@users.noreply.github.com>
Date: Thu, 23 Jan 2025 17:33:08 +0100
Subject: [PATCH 09/43] feat(solidstart)!: No longer export
`sentrySolidStartVite` (#15143)
Since the default way of setting up the SDK and passing the Sentry
options is by wrapping the SolidStart config with `withSentry`, the
previous method of using the `sentrySolidStartVite` plugin is no longer
supported.
---
CHANGELOG.md | 44 --------------------
docs/migration/v8-to-v9.md | 16 +++++++
packages/solidstart/src/config/withSentry.ts | 2 +-
packages/solidstart/src/index.server.ts | 1 -
packages/solidstart/src/index.types.ts | 1 -
packages/solidstart/src/vite/index.ts | 1 -
6 files changed, 17 insertions(+), 48 deletions(-)
delete mode 100644 packages/solidstart/src/vite/index.ts
diff --git a/CHANGELOG.md b/CHANGELOG.md
index dcbfecab7da4..10de3a8c8ca5 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -12,50 +12,6 @@
Work in this release was contributed by @tjhiggins, @GrizliK1988, @davidturissini, @nwalters512, @aloisklink, @arturovt, @benjick, @maximepvrt, @mstrokin, and @kunal-511. Thank you for your contributions!
-- **feat(solidstart)!: Default to `--import` setup and add `autoInjectServerSentry` ([#14862](https://github.com/getsentry/sentry-javascript/pull/14862))**
-
-To enable the SolidStart SDK, wrap your SolidStart Config with `withSentry`. The `sentrySolidStartVite` plugin is now automatically
-added by `withSentry` and you can pass the Sentry build-time options like this:
-
-```js
-import { defineConfig } from '@solidjs/start/config';
-import { withSentry } from '@sentry/solidstart';
-
-export default defineConfig(
- withSentry(
- {
- /* Your SolidStart config options... */
- },
- {
- // Options for setting up source maps
- org: process.env.SENTRY_ORG,
- project: process.env.SENTRY_PROJECT,
- authToken: process.env.SENTRY_AUTH_TOKEN,
- },
- ),
-);
-```
-
-With the `withSentry` wrapper, the Sentry server config should not be added to the `public` directory anymore.
-Add the Sentry server config in `src/instrument.server.ts`. Then, the server config will be placed inside the server build output as `instrument.server.mjs`.
-
-Now, there are two options to set up the SDK:
-
-1. **(recommended)** Provide an `--import` CLI flag to the start command like this (path depends on your server setup):
- `node --import ./.output/server/instrument.server.mjs .output/server/index.mjs`
-2. Add `autoInjectServerSentry: 'top-level-import'` and the Sentry config will be imported at the top of the server entry (comes with tracing limitations)
- ```js
- withSentry(
- {
- /* Your SolidStart config options... */
- },
- {
- // Optional: Install Sentry with a top-level import
- autoInjectServerSentry: 'top-level-import',
- },
- );
- ```
-
## 9.0.0-alpha.0
This is an alpha release of the upcoming major release of version 9.
diff --git a/docs/migration/v8-to-v9.md b/docs/migration/v8-to-v9.md
index a6bd0aa35e7c..e279fb0ebc86 100644
--- a/docs/migration/v8-to-v9.md
+++ b/docs/migration/v8-to-v9.md
@@ -234,6 +234,22 @@ Sentry.init({
- The `addNormalizedRequestDataToEvent` method has been removed. Use `httpRequestToRequestData` instead and put the resulting object directly on `event.request`.
- A `sampleRand` field on `PropagationContext` is now required. This is relevant if you used `scope.setPropagationContext(...)`
+### `@sentry/solidstart`
+
+- The `sentrySolidStartVite` plugin is no longer exported. Instead, wrap the SolidStart config with `withSentry` and
+ provide Sentry options as the second parameter.
+
+ ```
+ // app.config.ts
+ import { defineConfig } from '@solidjs/start/config';
+ import { withSentry } from '@sentry/solidstart';
+
+ export default defineConfig(withSentry(
+ { /* SolidStart config */ },
+ { /* Sentry build-time config (like project and org) */ })
+ );
+ ```
+
#### Other/Internal Changes
The following changes are unlikely to affect users of the SDK. They are listed here only for completion sake, and to alert users that may be relying on internal behavior.
diff --git a/packages/solidstart/src/config/withSentry.ts b/packages/solidstart/src/config/withSentry.ts
index c1050f0da1cc..aa045ade00ab 100644
--- a/packages/solidstart/src/config/withSentry.ts
+++ b/packages/solidstart/src/config/withSentry.ts
@@ -1,6 +1,6 @@
import { logger } from '@sentry/core';
import type { Nitro } from 'nitropack';
-import { addSentryPluginToVite } from '../vite';
+import { addSentryPluginToVite } from '../vite/sentrySolidStartVite';
import type { SentrySolidStartPluginOptions } from '../vite/types';
import {
addDynamicImportEntryFileWrapper,
diff --git a/packages/solidstart/src/index.server.ts b/packages/solidstart/src/index.server.ts
index a20a0367f557..82b6fe6cbff4 100644
--- a/packages/solidstart/src/index.server.ts
+++ b/packages/solidstart/src/index.server.ts
@@ -1,3 +1,2 @@
export * from './server';
-export * from './vite';
export * from './config';
diff --git a/packages/solidstart/src/index.types.ts b/packages/solidstart/src/index.types.ts
index 39f9831c543c..54a5ec6d6a3c 100644
--- a/packages/solidstart/src/index.types.ts
+++ b/packages/solidstart/src/index.types.ts
@@ -3,7 +3,6 @@
// exports in this file - which we do below.
export * from './client';
export * from './server';
-export * from './vite';
export * from './config';
import type { Client, Integration, Options, StackParser } from '@sentry/core';
diff --git a/packages/solidstart/src/vite/index.ts b/packages/solidstart/src/vite/index.ts
deleted file mode 100644
index 464bbd604fbe..000000000000
--- a/packages/solidstart/src/vite/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from './sentrySolidStartVite';
From 965185cbb8bf801fcddebea3a0fead4e3f152c29 Mon Sep 17 00:00:00 2001
From: Jacob Hands
Date: Thu, 23 Jan 2025 11:41:14 -0600
Subject: [PATCH 10/43] feat(core): Improve error formatting in ZodErrors
integration (#15111)
- Include full key path rather than the top level key in title
- Improve message for validation issues with no path
- Add option to include extended issue information as an attachment
---
packages/core/package.json | 5 +-
packages/core/src/integrations/zoderrors.ts | 170 +++++--
.../test/lib/integrations/zoderrrors.test.ts | 432 +++++++++++++++++-
yarn.lock | 43 +-
4 files changed, 576 insertions(+), 74 deletions(-)
diff --git a/packages/core/package.json b/packages/core/package.json
index 06e8d253a628..7724f703833e 100644
--- a/packages/core/package.json
+++ b/packages/core/package.json
@@ -61,5 +61,8 @@
"volta": {
"extends": "../../package.json"
},
- "sideEffects": false
+ "sideEffects": false,
+ "devDependencies": {
+ "zod": "^3.24.1"
+ }
}
diff --git a/packages/core/src/integrations/zoderrors.ts b/packages/core/src/integrations/zoderrors.ts
index a408285800d9..4859ca5167fa 100644
--- a/packages/core/src/integrations/zoderrors.ts
+++ b/packages/core/src/integrations/zoderrors.ts
@@ -5,33 +5,45 @@ import { truncate } from '../utils-hoist/string';
interface ZodErrorsOptions {
key?: string;
+ /**
+ * Limits the number of Zod errors inlined in each Sentry event.
+ *
+ * @default 10
+ */
limit?: number;
+ /**
+ * Save full list of Zod issues as an attachment in Sentry
+ *
+ * @default false
+ */
+ saveZodIssuesAsAttachment?: boolean;
}
const DEFAULT_LIMIT = 10;
const INTEGRATION_NAME = 'ZodErrors';
-// Simplified ZodIssue type definition
+/**
+ * Simplified ZodIssue type definition
+ */
interface ZodIssue {
path: (string | number)[];
message?: string;
- expected?: string | number;
- received?: string | number;
+ expected?: unknown;
+ received?: unknown;
unionErrors?: unknown[];
keys?: unknown[];
+ invalid_literal?: unknown;
}
interface ZodError extends Error {
issues: ZodIssue[];
-
- get errors(): ZodError['issues'];
}
function originalExceptionIsZodError(originalException: unknown): originalException is ZodError {
return (
isError(originalException) &&
originalException.name === 'ZodError' &&
- Array.isArray((originalException as ZodError).errors)
+ Array.isArray((originalException as ZodError).issues)
);
}
@@ -45,9 +57,18 @@ type SingleLevelZodIssue = {
/**
* Formats child objects or arrays to a string
- * That is preserved when sent to Sentry
+ * that is preserved when sent to Sentry.
+ *
+ * Without this, we end up with something like this in Sentry:
+ *
+ * [
+ * [Object],
+ * [Object],
+ * [Object],
+ * [Object]
+ * ]
*/
-function formatIssueTitle(issue: ZodIssue): SingleLevelZodIssue {
+export function flattenIssue(issue: ZodIssue): SingleLevelZodIssue {
return {
...issue,
path: 'path' in issue && Array.isArray(issue.path) ? issue.path.join('.') : undefined,
@@ -56,64 +77,145 @@ function formatIssueTitle(issue: ZodIssue): SingleLevelZodIssue {
};
}
+/**
+ * Takes ZodError issue path array and returns a flattened version as a string.
+ * This makes it easier to display paths within a Sentry error message.
+ *
+ * Array indexes are normalized to reduce duplicate entries
+ *
+ * @param path ZodError issue path
+ * @returns flattened path
+ *
+ * @example
+ * flattenIssuePath([0, 'foo', 1, 'bar']) // -> '.foo..bar'
+ */
+export function flattenIssuePath(path: Array): string {
+ return path
+ .map(p => {
+ if (typeof p === 'number') {
+ return '';
+ } else {
+ return p;
+ }
+ })
+ .join('.');
+}
+
/**
* Zod error message is a stringified version of ZodError.issues
* This doesn't display well in the Sentry UI. Replace it with something shorter.
*/
-function formatIssueMessage(zodError: ZodError): string {
+export function formatIssueMessage(zodError: ZodError): string {
const errorKeyMap = new Set();
for (const iss of zodError.issues) {
- if (iss.path?.[0]) {
- errorKeyMap.add(iss.path[0]);
+ const issuePath = flattenIssuePath(iss.path);
+ if (issuePath.length > 0) {
+ errorKeyMap.add(issuePath);
}
}
- const errorKeys = Array.from(errorKeyMap);
+ const errorKeys = Array.from(errorKeyMap);
+ if (errorKeys.length === 0) {
+ // If there are no keys, then we're likely validating the root
+ // variable rather than a key within an object. This attempts
+ // to extract what type it was that failed to validate.
+ // For example, z.string().parse(123) would return "string" here.
+ let rootExpectedType = 'variable';
+ if (zodError.issues.length > 0) {
+ const iss = zodError.issues[0];
+ if (iss !== undefined && 'expected' in iss && typeof iss.expected === 'string') {
+ rootExpectedType = iss.expected;
+ }
+ }
+ return `Failed to validate ${rootExpectedType}`;
+ }
return `Failed to validate keys: ${truncate(errorKeys.join(', '), 100)}`;
}
/**
- * Applies ZodError issues to an event extras and replaces the error message
+ * Applies ZodError issues to an event extra and replaces the error message
*/
-export function applyZodErrorsToEvent(limit: number, event: Event, hint?: EventHint): Event {
+export function applyZodErrorsToEvent(
+ limit: number,
+ saveZodIssuesAsAttachment: boolean = false,
+ event: Event,
+ hint: EventHint,
+): Event {
if (
!event.exception?.values ||
- !hint?.originalException ||
+ !hint.originalException ||
!originalExceptionIsZodError(hint.originalException) ||
hint.originalException.issues.length === 0
) {
return event;
}
- return {
- ...event,
- exception: {
- ...event.exception,
- values: [
- {
- ...event.exception.values[0],
- value: formatIssueMessage(hint.originalException),
+ try {
+ const issuesToFlatten = saveZodIssuesAsAttachment
+ ? hint.originalException.issues
+ : hint.originalException.issues.slice(0, limit);
+ const flattenedIssues = issuesToFlatten.map(flattenIssue);
+
+ if (saveZodIssuesAsAttachment) {
+ // Sometimes having the full error details can be helpful.
+ // Attachments have much higher limits, so we can include the full list of issues.
+ if (!Array.isArray(hint.attachments)) {
+ hint.attachments = [];
+ }
+ hint.attachments.push({
+ filename: 'zod_issues.json',
+ data: JSON.stringify({
+ issues: flattenedIssues,
+ }),
+ });
+ }
+
+ return {
+ ...event,
+ exception: {
+ ...event.exception,
+ values: [
+ {
+ ...event.exception.values[0],
+ value: formatIssueMessage(hint.originalException),
+ },
+ ...event.exception.values.slice(1),
+ ],
+ },
+ extra: {
+ ...event.extra,
+ 'zoderror.issues': flattenedIssues.slice(0, limit),
+ },
+ };
+ } catch (e) {
+ // Hopefully we never throw errors here, but record it
+ // with the event just in case.
+ return {
+ ...event,
+ extra: {
+ ...event.extra,
+ 'zoderrors sentry integration parse error': {
+ message: 'an exception was thrown while processing ZodError within applyZodErrorsToEvent()',
+ error: e instanceof Error ? `${e.name}: ${e.message}\n${e.stack}` : 'unknown',
},
- ...event.exception.values.slice(1),
- ],
- },
- extra: {
- ...event.extra,
- 'zoderror.issues': hint.originalException.errors.slice(0, limit).map(formatIssueTitle),
- },
- };
+ },
+ };
+ }
}
const _zodErrorsIntegration = ((options: ZodErrorsOptions = {}) => {
- const limit = options.limit || DEFAULT_LIMIT;
+ const limit = options.limit ?? DEFAULT_LIMIT;
return {
name: INTEGRATION_NAME,
- processEvent(originalEvent, hint) {
- const processedEvent = applyZodErrorsToEvent(limit, originalEvent, hint);
+ processEvent(originalEvent, hint): Event {
+ const processedEvent = applyZodErrorsToEvent(limit, options.saveZodIssuesAsAttachment, originalEvent, hint);
return processedEvent;
},
};
}) satisfies IntegrationFn;
+/**
+ * Sentry integration to process Zod errors, making them easier to work with in Sentry.
+ */
export const zodErrorsIntegration = defineIntegration(_zodErrorsIntegration);
diff --git a/packages/core/test/lib/integrations/zoderrrors.test.ts b/packages/core/test/lib/integrations/zoderrrors.test.ts
index 924ee5dd27da..cd80e2347f36 100644
--- a/packages/core/test/lib/integrations/zoderrrors.test.ts
+++ b/packages/core/test/lib/integrations/zoderrrors.test.ts
@@ -1,6 +1,12 @@
+import { z } from 'zod';
import type { Event, EventHint } from '../../../src/types-hoist';
-import { applyZodErrorsToEvent } from '../../../src/integrations/zoderrors';
+import {
+ applyZodErrorsToEvent,
+ flattenIssue,
+ flattenIssuePath,
+ formatIssueMessage,
+} from '../../../src/integrations/zoderrors';
// Simplified type definition
interface ZodIssue {
@@ -40,13 +46,13 @@ describe('applyZodErrorsToEvent()', () => {
test('should not do anything if exception is not a ZodError', () => {
const event: Event = {};
const eventHint: EventHint = { originalException: new Error() };
- applyZodErrorsToEvent(100, event, eventHint);
+ applyZodErrorsToEvent(100, false, event, eventHint);
// no changes
expect(event).toStrictEqual({});
});
- test('should add ZodError issues to extras and format message', () => {
+ test('should add ZodError issues to extra and format message', () => {
const issues = [
{
code: 'invalid_type',
@@ -71,13 +77,13 @@ describe('applyZodErrorsToEvent()', () => {
};
const eventHint: EventHint = { originalException };
- const processedEvent = applyZodErrorsToEvent(100, event, eventHint);
+ const processedEvent = applyZodErrorsToEvent(100, false, event, eventHint);
expect(processedEvent.exception).toStrictEqual({
values: [
{
type: 'Error',
- value: 'Failed to validate keys: names',
+ value: 'Failed to validate keys: names.',
},
],
});
@@ -92,5 +98,421 @@ describe('applyZodErrorsToEvent()', () => {
},
],
});
+
+ // No attachments added
+ expect(eventHint.attachments).toBe(undefined);
+ });
+
+ test('should add all ZodError issues as attachment', () => {
+ const issues = [
+ {
+ code: 'invalid_type',
+ expected: 'string',
+ received: 'number',
+ path: ['names', 1],
+ keys: ['extra'],
+ message: 'Invalid input: expected string, received number',
+ },
+ {
+ code: 'invalid_type',
+ expected: 'string',
+ received: 'number',
+ path: ['foo', 1],
+ keys: ['extra2'],
+ message: 'Invalid input: expected string, received number',
+ },
+ ] satisfies ZodIssue[];
+ const originalException = ZodError.create(issues);
+
+ const event: Event = {
+ exception: {
+ values: [
+ {
+ type: 'Error',
+ value: originalException.message,
+ },
+ ],
+ },
+ };
+
+ const eventHint: EventHint = { originalException };
+ const processedEvent = applyZodErrorsToEvent(1, true, event, eventHint);
+
+ expect(processedEvent.exception).toStrictEqual({
+ values: [
+ {
+ type: 'Error',
+ value: 'Failed to validate keys: names., foo.',
+ },
+ ],
+ });
+
+ // Only adds the first issue to extra due to the limit
+ expect(processedEvent.extra).toStrictEqual({
+ 'zoderror.issues': [
+ {
+ ...issues[0],
+ path: issues[0]?.path.join('.'),
+ keys: JSON.stringify(issues[0]?.keys),
+ unionErrors: undefined,
+ },
+ ],
+ });
+
+ // hint attachments contains the full issue list
+ expect(Array.isArray(eventHint.attachments)).toBe(true);
+ expect(eventHint.attachments?.length).toBe(1);
+ const attachment = eventHint.attachments?.[0];
+ if (attachment === undefined) {
+ throw new Error('attachment is undefined');
+ }
+ expect(attachment.filename).toBe('zod_issues.json');
+ expect(JSON.parse(attachment.data.toString())).toMatchInlineSnapshot(`
+Object {
+ "issues": Array [
+ Object {
+ "code": "invalid_type",
+ "expected": "string",
+ "keys": "[\\"extra\\"]",
+ "message": "Invalid input: expected string, received number",
+ "path": "names.1",
+ "received": "number",
+ },
+ Object {
+ "code": "invalid_type",
+ "expected": "string",
+ "keys": "[\\"extra2\\"]",
+ "message": "Invalid input: expected string, received number",
+ "path": "foo.1",
+ "received": "number",
+ },
+ ],
+}
+`);
+ });
+});
+
+describe('flattenIssue()', () => {
+ it('flattens path field', () => {
+ const zodError = z
+ .object({
+ foo: z.string().min(1),
+ nested: z.object({
+ bar: z.literal('baz'),
+ }),
+ })
+ .safeParse({
+ foo: '',
+ nested: {
+ bar: 'not-baz',
+ },
+ }).error;
+ if (zodError === undefined) {
+ throw new Error('zodError is undefined');
+ }
+
+ // Original zod error
+ expect(zodError.issues).toMatchInlineSnapshot(`
+Array [
+ Object {
+ "code": "too_small",
+ "exact": false,
+ "inclusive": true,
+ "message": "String must contain at least 1 character(s)",
+ "minimum": 1,
+ "path": Array [
+ "foo",
+ ],
+ "type": "string",
+ },
+ Object {
+ "code": "invalid_literal",
+ "expected": "baz",
+ "message": "Invalid literal value, expected \\"baz\\"",
+ "path": Array [
+ "nested",
+ "bar",
+ ],
+ "received": "not-baz",
+ },
+]
+`);
+
+ const issues = zodError.issues;
+ expect(issues.length).toBe(2);
+
+ // Format it for use in Sentry
+ expect(issues.map(flattenIssue)).toMatchInlineSnapshot(`
+Array [
+ Object {
+ "code": "too_small",
+ "exact": false,
+ "inclusive": true,
+ "keys": undefined,
+ "message": "String must contain at least 1 character(s)",
+ "minimum": 1,
+ "path": "foo",
+ "type": "string",
+ "unionErrors": undefined,
+ },
+ Object {
+ "code": "invalid_literal",
+ "expected": "baz",
+ "keys": undefined,
+ "message": "Invalid literal value, expected \\"baz\\"",
+ "path": "nested.bar",
+ "received": "not-baz",
+ "unionErrors": undefined,
+ },
+]
+`);
+
+ expect(zodError.flatten(flattenIssue)).toMatchInlineSnapshot(`
+Object {
+ "fieldErrors": Object {
+ "foo": Array [
+ Object {
+ "code": "too_small",
+ "exact": false,
+ "inclusive": true,
+ "keys": undefined,
+ "message": "String must contain at least 1 character(s)",
+ "minimum": 1,
+ "path": "foo",
+ "type": "string",
+ "unionErrors": undefined,
+ },
+ ],
+ "nested": Array [
+ Object {
+ "code": "invalid_literal",
+ "expected": "baz",
+ "keys": undefined,
+ "message": "Invalid literal value, expected \\"baz\\"",
+ "path": "nested.bar",
+ "received": "not-baz",
+ "unionErrors": undefined,
+ },
+ ],
+ },
+ "formErrors": Array [],
+}
+`);
+ });
+
+ it('flattens keys field to string', () => {
+ const zodError = z
+ .object({
+ foo: z.string().min(1),
+ })
+ .strict()
+ .safeParse({
+ foo: 'bar',
+ extra_key_abc: 'hello',
+ extra_key_def: 'world',
+ }).error;
+ if (zodError === undefined) {
+ throw new Error('zodError is undefined');
+ }
+
+ // Original zod error
+ expect(zodError.issues).toMatchInlineSnapshot(`
+Array [
+ Object {
+ "code": "unrecognized_keys",
+ "keys": Array [
+ "extra_key_abc",
+ "extra_key_def",
+ ],
+ "message": "Unrecognized key(s) in object: 'extra_key_abc', 'extra_key_def'",
+ "path": Array [],
+ },
+]
+`);
+
+ const issues = zodError.issues;
+ expect(issues.length).toBe(1);
+
+ // Format it for use in Sentry
+ const iss = issues[0];
+ if (iss === undefined) {
+ throw new Error('iss is undefined');
+ }
+ const formattedIssue = flattenIssue(iss);
+
+ // keys is now a string rather than array.
+ // Note: path is an empty string because the issue is at the root.
+ // TODO: Maybe somehow make it clearer that this is at the root?
+ expect(formattedIssue).toMatchInlineSnapshot(`
+Object {
+ "code": "unrecognized_keys",
+ "keys": "[\\"extra_key_abc\\",\\"extra_key_def\\"]",
+ "message": "Unrecognized key(s) in object: 'extra_key_abc', 'extra_key_def'",
+ "path": "",
+ "unionErrors": undefined,
+}
+`);
+ expect(typeof formattedIssue.keys === 'string').toBe(true);
+ });
+});
+
+describe('flattenIssuePath()', () => {
+ it('returns single path', () => {
+ expect(flattenIssuePath(['foo'])).toBe('foo');
+ });
+
+ it('flattens nested string paths', () => {
+ expect(flattenIssuePath(['foo', 'bar'])).toBe('foo.bar');
+ });
+
+ it('uses placeholder for path index within array', () => {
+ expect(flattenIssuePath([0, 'foo', 1, 'bar', 'baz'])).toBe('.foo..bar.baz');
+ });
+});
+
+describe('formatIssueMessage()', () => {
+ it('adds invalid keys to message', () => {
+ const zodError = z
+ .object({
+ foo: z.string().min(1),
+ nested: z.object({
+ bar: z.literal('baz'),
+ }),
+ })
+ .safeParse({
+ foo: '',
+ nested: {
+ bar: 'not-baz',
+ },
+ }).error;
+ if (zodError === undefined) {
+ throw new Error('zodError is undefined');
+ }
+
+ const message = formatIssueMessage(zodError);
+ expect(message).toMatchInlineSnapshot('"Failed to validate keys: foo, nested.bar"');
+ });
+
+ describe('adds expected type if root variable is invalid', () => {
+ test('object', () => {
+ const zodError = z
+ .object({
+ foo: z.string().min(1),
+ })
+ .safeParse(123).error;
+ if (zodError === undefined) {
+ throw new Error('zodError is undefined');
+ }
+
+ // Original zod error
+ expect(zodError.issues).toMatchInlineSnapshot(`
+Array [
+ Object {
+ "code": "invalid_type",
+ "expected": "object",
+ "message": "Expected object, received number",
+ "path": Array [],
+ "received": "number",
+ },
+]
+`);
+
+ const message = formatIssueMessage(zodError);
+ expect(message).toMatchInlineSnapshot('"Failed to validate object"');
+ });
+
+ test('number', () => {
+ const zodError = z.number().safeParse('123').error;
+ if (zodError === undefined) {
+ throw new Error('zodError is undefined');
+ }
+
+ // Original zod error
+ expect(zodError.issues).toMatchInlineSnapshot(`
+Array [
+ Object {
+ "code": "invalid_type",
+ "expected": "number",
+ "message": "Expected number, received string",
+ "path": Array [],
+ "received": "string",
+ },
+]
+`);
+
+ const message = formatIssueMessage(zodError);
+ expect(message).toMatchInlineSnapshot('"Failed to validate number"');
+ });
+
+ test('string', () => {
+ const zodError = z.string().safeParse(123).error;
+ if (zodError === undefined) {
+ throw new Error('zodError is undefined');
+ }
+
+ // Original zod error
+ expect(zodError.issues).toMatchInlineSnapshot(`
+Array [
+ Object {
+ "code": "invalid_type",
+ "expected": "string",
+ "message": "Expected string, received number",
+ "path": Array [],
+ "received": "number",
+ },
+]
+`);
+
+ const message = formatIssueMessage(zodError);
+ expect(message).toMatchInlineSnapshot('"Failed to validate string"');
+ });
+
+ test('array', () => {
+ const zodError = z.string().array().safeParse('123').error;
+ if (zodError === undefined) {
+ throw new Error('zodError is undefined');
+ }
+
+ // Original zod error
+ expect(zodError.issues).toMatchInlineSnapshot(`
+Array [
+ Object {
+ "code": "invalid_type",
+ "expected": "array",
+ "message": "Expected array, received string",
+ "path": Array [],
+ "received": "string",
+ },
+]
+`);
+
+ const message = formatIssueMessage(zodError);
+ expect(message).toMatchInlineSnapshot('"Failed to validate array"');
+ });
+
+ test('wrong type in array', () => {
+ const zodError = z.string().array().safeParse([123]).error;
+ if (zodError === undefined) {
+ throw new Error('zodError is undefined');
+ }
+
+ // Original zod error
+ expect(zodError.issues).toMatchInlineSnapshot(`
+Array [
+ Object {
+ "code": "invalid_type",
+ "expected": "string",
+ "message": "Expected string, received number",
+ "path": Array [
+ 0,
+ ],
+ "received": "number",
+ },
+]
+`);
+
+ const message = formatIssueMessage(zodError);
+ expect(message).toMatchInlineSnapshot('"Failed to validate keys: "');
+ });
});
});
diff --git a/yarn.lock b/yarn.lock
index 5627089a7941..2e69bdb6d480 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -7890,12 +7890,7 @@
dependencies:
"@types/unist" "*"
-"@types/history-4@npm:@types/history@4.7.8":
- version "4.7.8"
- resolved "https://registry.yarnpkg.com/@types/history/-/history-4.7.8.tgz#49348387983075705fe8f4e02fb67f7daaec4934"
- integrity sha512-S78QIYirQcUoo6UJZx9CSP0O2ix9IaeAXwQi26Rhr/+mg7qqPy8TzaxHSUut7eGjL8WmLccT7/MXf304WjqHcA==
-
-"@types/history-5@npm:@types/history@4.7.8":
+"@types/history-4@npm:@types/history@4.7.8", "@types/history-5@npm:@types/history@4.7.8":
version "4.7.8"
resolved "https://registry.yarnpkg.com/@types/history/-/history-4.7.8.tgz#49348387983075705fe8f4e02fb67f7daaec4934"
integrity sha512-S78QIYirQcUoo6UJZx9CSP0O2ix9IaeAXwQi26Rhr/+mg7qqPy8TzaxHSUut7eGjL8WmLccT7/MXf304WjqHcA==
@@ -27426,16 +27421,7 @@ string-template@~0.2.1:
resolved "https://registry.yarnpkg.com/string-template/-/string-template-0.2.1.tgz#42932e598a352d01fc22ec3367d9d84eec6c9add"
integrity sha1-QpMuWYo1LQH8IuwzZ9nYTuxsmt0=
-"string-width-cjs@npm:string-width@^4.2.0":
- version "4.2.3"
- resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
- integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
- dependencies:
- emoji-regex "^8.0.0"
- is-fullwidth-code-point "^3.0.0"
- strip-ansi "^6.0.1"
-
-string-width@4.2.3, "string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.2, string-width@^4.2.3:
+"string-width-cjs@npm:string-width@^4.2.0", string-width@4.2.3, "string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.2, string-width@^4.2.3:
version "4.2.3"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
@@ -27538,14 +27524,7 @@ stringify-object@^3.2.1:
is-obj "^1.0.1"
is-regexp "^1.0.0"
-"strip-ansi-cjs@npm:strip-ansi@^6.0.1":
- version "6.0.1"
- resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
- integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
- dependencies:
- ansi-regex "^5.0.1"
-
-strip-ansi@6.0.1, strip-ansi@^6.0.0, strip-ansi@^6.0.1:
+"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@6.0.1, strip-ansi@^6.0.0, strip-ansi@^6.0.1:
version "6.0.1"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
@@ -30335,16 +30314,7 @@ wrangler@^3.67.1:
optionalDependencies:
fsevents "~2.3.2"
-"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0":
- version "7.0.0"
- resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
- integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
- dependencies:
- ansi-styles "^4.0.0"
- string-width "^4.1.0"
- strip-ansi "^6.0.0"
-
-wrap-ansi@7.0.0, wrap-ansi@^7.0.0:
+"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@7.0.0, wrap-ansi@^7.0.0:
version "7.0.0"
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
@@ -30646,6 +30616,11 @@ zod@^3.22.3, zod@^3.22.4:
resolved "https://registry.yarnpkg.com/zod/-/zod-3.23.8.tgz#e37b957b5d52079769fb8097099b592f0ef4067d"
integrity sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g==
+zod@^3.24.1:
+ version "3.24.1"
+ resolved "https://registry.yarnpkg.com/zod/-/zod-3.24.1.tgz#27445c912738c8ad1e9de1bea0359fa44d9d35ee"
+ integrity sha512-muH7gBL9sI1nciMZV67X5fTKKBLtwpZ5VBp1vsOQzj1MhrBZ4wlVCm3gedKZWLp0Oyel8sIGfeiz54Su+OVT+A==
+
zone.js@^0.12.0:
version "0.12.0"
resolved "https://registry.yarnpkg.com/zone.js/-/zone.js-0.12.0.tgz#a4a6e5fab6d34bd37d89c77e89ac2e6f4a3d2c30"
From 2e708dcdd257a75fa585475a9e536e7840d71616 Mon Sep 17 00:00:00 2001
From: Daniel Griesser
Date: Thu, 23 Jan 2025 19:18:23 +0100
Subject: [PATCH 11/43] chore: Add external contributor to CHANGELOG.md
(#15152)
This PR adds the external contributor to the CHANGELOG.md file, so that
they are credited for their contribution. See #15111
Co-authored-by: Abhijeet Prasad
---
CHANGELOG.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 10de3a8c8ca5..c0861fcc85cc 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -10,7 +10,7 @@
- "You miss 100 percent of the chances you don't take. — Wayne Gretzky" — Michael Scott
-Work in this release was contributed by @tjhiggins, @GrizliK1988, @davidturissini, @nwalters512, @aloisklink, @arturovt, @benjick, @maximepvrt, @mstrokin, and @kunal-511. Thank you for your contributions!
+Work in this release was contributed by @tjhiggins, @GrizliK1988, @davidturissini, @nwalters512, @aloisklink, @arturovt, @benjick, @maximepvrt, @mstrokin, @kunal-511, and @jahands. Thank you for your contributions!
## 9.0.0-alpha.0
From 5bc956dba00cdeb94462c2eaf9a2a18a6653b0c5 Mon Sep 17 00:00:00 2001
From: Philipp Hofmann
Date: Fri, 24 Jan 2025 16:09:15 +0100
Subject: [PATCH 12/43] Reference LOGAF Scale from develop docs (#15154)
Link to the Sentry develop docs for explaining the LOGAF scale.
---
docs/pr-reviews.md | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/docs/pr-reviews.md b/docs/pr-reviews.md
index 87b5faafb950..65703c2cebb6 100644
--- a/docs/pr-reviews.md
+++ b/docs/pr-reviews.md
@@ -2,12 +2,8 @@
Make sure to open PRs against `develop` branch.
-For feedback in PRs, we use the [LOGAF scale](https://blog.danlew.net/2020/04/15/the-logaf-scale/) to specify how
-important a comment is:
-
-- `l`: low - nitpick. You may address this comment, but you don't have to.
-- `m`: medium - normal comment. Worth addressing and fixing.
-- `h`: high - Very important. We must not merge this PR without addressing this issue.
+For feedback in PRs, we use the [LOGAF scale](https://develop.sentry.dev/engineering-practices/code-review/#logaf-scale) to specify how
+important a comment is.
You only need one approval from a maintainer to be able to merge. For some PRs, asking specific or multiple people for
review might be adequate. You can either assign SDK team members directly (e.g. if you have some people in mind who are
From 8e37842bff9a4930967859157f469a5a9f145aef Mon Sep 17 00:00:00 2001
From: Nathan Kleyn
Date: Fri, 24 Jan 2025 18:08:30 +0000
Subject: [PATCH 13/43] fix(bun): Ensure instrumentation of `Bun.serve`
survives a server reload (#15148)
If `#reload` is called on an instance of `Bun.serve`, the Sentry
intrumentation doesn't surive. This is because the Bun instrumentation
works by using `Proxy` on the call to `Bun.serve`, which isn't called
for a reload.
We can't wrap the serve created by calling `Bun.serve` with a `Proxy` as
Bun seems to do some internal checks using `instanceof` which break if
the instance is now reporting itself as a `ProxyObject`.
---
packages/bun/src/integrations/bunserver.ts | 13 +-
.../bun/test/integrations/bunserver.test.ts | 130 +++++++++++++-----
packages/bun/test/sdk.test.ts | 20 ++-
3 files changed, 119 insertions(+), 44 deletions(-)
diff --git a/packages/bun/src/integrations/bunserver.ts b/packages/bun/src/integrations/bunserver.ts
index d8ee46abae73..1f1974839455 100644
--- a/packages/bun/src/integrations/bunserver.ts
+++ b/packages/bun/src/integrations/bunserver.ts
@@ -47,7 +47,18 @@ export function instrumentBunServe(): void {
Bun.serve = new Proxy(Bun.serve, {
apply(serveTarget, serveThisArg, serveArgs: Parameters) {
instrumentBunServeOptions(serveArgs[0]);
- return serveTarget.apply(serveThisArg, serveArgs);
+ const server: ReturnType = serveTarget.apply(serveThisArg, serveArgs);
+
+ // A Bun server can be reloaded, re-wrap any fetch function passed to it
+ // We can't use a Proxy for this as Bun does `instanceof` checks internally that fail if we
+ // wrap the Server instance.
+ const originalReload: typeof server.reload = server.reload.bind(server);
+ server.reload = (serveOptions: Parameters[0]) => {
+ instrumentBunServeOptions(serveOptions);
+ return originalReload(serveOptions);
+ };
+
+ return server;
},
});
}
diff --git a/packages/bun/test/integrations/bunserver.test.ts b/packages/bun/test/integrations/bunserver.test.ts
index b1dc17381ccb..dd1f738a334b 100644
--- a/packages/bun/test/integrations/bunserver.test.ts
+++ b/packages/bun/test/integrations/bunserver.test.ts
@@ -1,67 +1,87 @@
-import { beforeAll, beforeEach, describe, expect, test } from 'bun:test';
+import { afterEach, beforeAll, beforeEach, describe, expect, test } from 'bun:test';
+import type { Span } from '@sentry/core';
import { getDynamicSamplingContextFromSpan, setCurrentClient, spanIsSampled, spanToJSON } from '@sentry/core';
import { BunClient } from '../../src/client';
import { instrumentBunServe } from '../../src/integrations/bunserver';
import { getDefaultBunClientOptions } from '../helpers';
-// Fun fact: Bun = 2 21 14 :)
-const DEFAULT_PORT = 22114;
-
describe('Bun Serve Integration', () => {
let client: BunClient;
+ // Fun fact: Bun = 2 21 14 :)
+ let port: number = 22114;
beforeAll(() => {
instrumentBunServe();
});
beforeEach(() => {
- const options = getDefaultBunClientOptions({ tracesSampleRate: 1, debug: true });
+ const options = getDefaultBunClientOptions({ tracesSampleRate: 1 });
client = new BunClient(options);
setCurrentClient(client);
client.init();
});
+ afterEach(() => {
+ // Don't reuse the port; Bun server stops lazily so tests may accidentally hit a server still closing from a
+ // previous test
+ port += 1;
+ });
+
test('generates a transaction around a request', async () => {
+ let generatedSpan: Span | undefined;
+
client.on('spanEnd', span => {
- expect(spanToJSON(span).status).toBe('ok');
- expect(spanToJSON(span).data?.['http.response.status_code']).toEqual(200);
- expect(spanToJSON(span).op).toEqual('http.server');
- expect(spanToJSON(span).description).toEqual('GET /');
+ generatedSpan = span;
});
const server = Bun.serve({
async fetch(_req) {
return new Response('Bun!');
},
- port: DEFAULT_PORT,
+ port,
});
+ await fetch(`http://localhost:${port}/`);
+ server.stop();
- await fetch('http://localhost:22114/');
+ if (!generatedSpan) {
+ throw 'No span was generated in the test';
+ }
- server.stop();
+ expect(spanToJSON(generatedSpan).status).toBe('ok');
+ expect(spanToJSON(generatedSpan).data?.['http.response.status_code']).toEqual(200);
+ expect(spanToJSON(generatedSpan).op).toEqual('http.server');
+ expect(spanToJSON(generatedSpan).description).toEqual('GET /');
});
test('generates a post transaction', async () => {
+ let generatedSpan: Span | undefined;
+
client.on('spanEnd', span => {
- expect(spanToJSON(span).status).toBe('ok');
- expect(spanToJSON(span).data?.['http.response.status_code']).toEqual(200);
- expect(spanToJSON(span).op).toEqual('http.server');
- expect(spanToJSON(span).description).toEqual('POST /');
+ generatedSpan = span;
});
const server = Bun.serve({
async fetch(_req) {
return new Response('Bun!');
},
- port: DEFAULT_PORT,
+ port,
});
- await fetch('http://localhost:22114/', {
+ await fetch(`http://localhost:${port}/`, {
method: 'POST',
});
server.stop();
+
+ if (!generatedSpan) {
+ throw 'No span was generated in the test';
+ }
+
+ expect(spanToJSON(generatedSpan).status).toBe('ok');
+ expect(spanToJSON(generatedSpan).data?.['http.response.status_code']).toEqual(200);
+ expect(spanToJSON(generatedSpan).op).toEqual('http.server');
+ expect(spanToJSON(generatedSpan).description).toEqual('POST /');
});
test('continues a trace', async () => {
@@ -70,55 +90,93 @@ describe('Bun Serve Integration', () => {
const PARENT_SAMPLED = '1';
const SENTRY_TRACE_HEADER = `${TRACE_ID}-${PARENT_SPAN_ID}-${PARENT_SAMPLED}`;
- const SENTRY_BAGGAGE_HEADER = 'sentry-version=1.0,sentry-environment=production';
+ const SENTRY_BAGGAGE_HEADER = 'sentry-version=1.0,sentry-sample_rand=0.42,sentry-environment=production';
- client.on('spanEnd', span => {
- expect(span.spanContext().traceId).toBe(TRACE_ID);
- expect(spanToJSON(span).parent_span_id).toBe(PARENT_SPAN_ID);
- expect(spanIsSampled(span)).toBe(true);
- expect(span.isRecording()).toBe(false);
+ let generatedSpan: Span | undefined;
- expect(getDynamicSamplingContextFromSpan(span)).toStrictEqual({
- version: '1.0',
- environment: 'production',
- });
+ client.on('spanEnd', span => {
+ generatedSpan = span;
});
const server = Bun.serve({
async fetch(_req) {
return new Response('Bun!');
},
- port: DEFAULT_PORT,
+ port,
});
- await fetch('http://localhost:22114/', {
+ await fetch(`http://localhost:${port}/`, {
headers: { 'sentry-trace': SENTRY_TRACE_HEADER, baggage: SENTRY_BAGGAGE_HEADER },
});
server.stop();
+
+ if (!generatedSpan) {
+ throw 'No span was generated in the test';
+ }
+
+ expect(generatedSpan.spanContext().traceId).toBe(TRACE_ID);
+ expect(spanToJSON(generatedSpan).parent_span_id).toBe(PARENT_SPAN_ID);
+ expect(spanIsSampled(generatedSpan)).toBe(true);
+ expect(generatedSpan.isRecording()).toBe(false);
+
+ expect(getDynamicSamplingContextFromSpan(generatedSpan)).toStrictEqual({
+ version: '1.0',
+ sample_rand: '0.42',
+ environment: 'production',
+ });
});
test('does not create transactions for OPTIONS or HEAD requests', async () => {
- client.on('spanEnd', () => {
- // This will never run, but we want to make sure it doesn't run.
- expect(false).toEqual(true);
+ let generatedSpan: Span | undefined;
+
+ client.on('spanEnd', span => {
+ generatedSpan = span;
});
const server = Bun.serve({
async fetch(_req) {
return new Response('Bun!');
},
- port: DEFAULT_PORT,
+ port,
});
- await fetch('http://localhost:22114/', {
+ await fetch(`http://localhost:${port}/`, {
method: 'OPTIONS',
});
- await fetch('http://localhost:22114/', {
+ await fetch(`http://localhost:${port}/`, {
method: 'HEAD',
});
server.stop();
+
+ expect(generatedSpan).toBeUndefined();
+ });
+
+ test('intruments the server again if it is reloaded', async () => {
+ let serverWasInstrumented = false;
+ client.on('spanEnd', () => {
+ serverWasInstrumented = true;
+ });
+
+ const server = Bun.serve({
+ async fetch(_req) {
+ return new Response('Bun!');
+ },
+ port,
+ });
+
+ server.reload({
+ async fetch(_req) {
+ return new Response('Reloaded Bun!');
+ },
+ });
+
+ await fetch(`http://localhost:${port}/`);
+
+ server.stop();
+
+ expect(serverWasInstrumented).toBeTrue();
});
});
diff --git a/packages/bun/test/sdk.test.ts b/packages/bun/test/sdk.test.ts
index a548cc2614c7..11870f30c101 100644
--- a/packages/bun/test/sdk.test.ts
+++ b/packages/bun/test/sdk.test.ts
@@ -1,14 +1,20 @@
-import { expect, test } from 'bun:test';
+import { describe, expect, test } from 'bun:test';
import { init } from '../src/index';
-test("calling init shouldn't fail", () => {
- init({
+describe('Bun SDK', () => {
+ const initOptions = {
dsn: 'https://00000000000000000000000000000000@o000000.ingest.sentry.io/0000000',
+ tracesSampleRate: 1,
+ };
+
+ test("calling init shouldn't fail", () => {
+ expect(() => {
+ init(initOptions);
+ }).not.toThrow();
});
- expect(true).toBe(true);
-});
-test('should return client from init', () => {
- expect(init({})).not.toBeUndefined();
+ test('should return client from init', () => {
+ expect(init(initOptions)).not.toBeUndefined();
+ });
});
From a67d3ca606589326719481fa5405e8f67ed273b9 Mon Sep 17 00:00:00 2001
From: Daniel Griesser
Date: Fri, 24 Jan 2025 19:21:02 +0100
Subject: [PATCH 14/43] chore: Add external contributor to CHANGELOG.md
(#15156)
This PR adds the external contributor to the CHANGELOG.md file, so that
they are credited for their contribution. See #15148
---------
Co-authored-by: AbhiPrasad <18689448+AbhiPrasad@users.noreply.github.com>
Co-authored-by: Abhijeet Prasad
---
CHANGELOG.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index c0861fcc85cc..9afee28eb184 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -10,7 +10,7 @@
- "You miss 100 percent of the chances you don't take. — Wayne Gretzky" — Michael Scott
-Work in this release was contributed by @tjhiggins, @GrizliK1988, @davidturissini, @nwalters512, @aloisklink, @arturovt, @benjick, @maximepvrt, @mstrokin, @kunal-511, and @jahands. Thank you for your contributions!
+Work in this release was contributed by @tjhiggins, @GrizliK1988, @davidturissini, @nwalters512, @aloisklink, @arturovt, @benjick, @maximepvrt, @mstrokin, @kunal-511, @jahands, and @nathankleyn. Thank you for your contributions!
## 9.0.0-alpha.0
From 70d53a992836945fc80db2e0a16b74ed1acaecbe Mon Sep 17 00:00:00 2001
From: "Randolf J." <34705014+jrandolf@users.noreply.github.com>
Date: Mon, 27 Jan 2025 01:00:30 -0800
Subject: [PATCH 15/43] fix(core): Pass `module` into `loadModule` (#15139)
The `loadModule` function currently utilizes `require` to load modules
starting from the `@sentry/core` directory. This approach is
incompatible with package managers like pnpm, which do not hoist
dependencies. Consequently, when another module, such as @sentry/nextjs,
invokes `loadModule`, it fails to locate its own dependencies because
the search initiates within the @sentry/core tree.
---
packages/core/src/utils-hoist/node.ts | 10 ++++++----
packages/nextjs/src/config/webpack.ts | 2 +-
packages/remix/src/utils/instrumentServer.ts | 2 +-
3 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/packages/core/src/utils-hoist/node.ts b/packages/core/src/utils-hoist/node.ts
index a0311efc7a93..94e8001863aa 100644
--- a/packages/core/src/utils-hoist/node.ts
+++ b/packages/core/src/utils-hoist/node.ts
@@ -41,21 +41,23 @@ function dynamicRequire(mod: any, request: string): any {
* That is to mimic the behavior of `require.resolve` exactly.
*
* @param moduleName module name to require
+ * @param existingModule module to use for requiring
* @returns possibly required module
*/
-export function loadModule(moduleName: string): T | undefined {
+// eslint-disable-next-line @typescript-eslint/no-explicit-any
+export function loadModule(moduleName: string, existingModule: any = module): T | undefined {
let mod: T | undefined;
try {
- mod = dynamicRequire(module, moduleName);
+ mod = dynamicRequire(existingModule, moduleName);
} catch (e) {
// no-empty
}
if (!mod) {
try {
- const { cwd } = dynamicRequire(module, 'process');
- mod = dynamicRequire(module, `${cwd()}/node_modules/${moduleName}`) as T;
+ const { cwd } = dynamicRequire(existingModule, 'process');
+ mod = dynamicRequire(existingModule, `${cwd()}/node_modules/${moduleName}`) as T;
} catch (e) {
// no-empty
}
diff --git a/packages/nextjs/src/config/webpack.ts b/packages/nextjs/src/config/webpack.ts
index bb73a2fb1859..8dbebf3935df 100644
--- a/packages/nextjs/src/config/webpack.ts
+++ b/packages/nextjs/src/config/webpack.ts
@@ -332,7 +332,7 @@ export function constructWebpackConfigFunction(
// Symbolication for dev-mode errors is done elsewhere.
if (!isDev) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
- const { sentryWebpackPlugin } = loadModule<{ sentryWebpackPlugin: any }>('@sentry/webpack-plugin') ?? {};
+ const { sentryWebpackPlugin } = loadModule<{ sentryWebpackPlugin: any }>('@sentry/webpack-plugin', module) ?? {};
if (sentryWebpackPlugin) {
if (!userSentryOptions.sourcemaps?.disable) {
diff --git a/packages/remix/src/utils/instrumentServer.ts b/packages/remix/src/utils/instrumentServer.ts
index a0dd11874416..c6113ea7f0a3 100644
--- a/packages/remix/src/utils/instrumentServer.ts
+++ b/packages/remix/src/utils/instrumentServer.ts
@@ -301,7 +301,7 @@ const makeWrappedCreateRequestHandler = () =>
export function instrumentServer(): void {
const pkg = loadModule<{
createRequestHandler: CreateRequestHandlerFunction;
- }>('@remix-run/server-runtime');
+ }>('@remix-run/server-runtime', module);
if (!pkg) {
DEBUG_BUILD && logger.warn('Remix SDK was unable to require `@remix-run/server-runtime` package.');
From 6571e0c608e70b462253ebcbbc158004fa57ae75 Mon Sep 17 00:00:00 2001
From: Daniel Griesser
Date: Mon, 27 Jan 2025 10:16:11 +0100
Subject: [PATCH 16/43] chore: Add external contributor to CHANGELOG.md
(#15165)
This PR adds the external contributor to the CHANGELOG.md file, so that
they are credited for their contribution. See #15139
---------
Co-authored-by: Lukas Stracke
---
CHANGELOG.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 9afee28eb184..a30b5747e9dc 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -10,7 +10,7 @@
- "You miss 100 percent of the chances you don't take. — Wayne Gretzky" — Michael Scott
-Work in this release was contributed by @tjhiggins, @GrizliK1988, @davidturissini, @nwalters512, @aloisklink, @arturovt, @benjick, @maximepvrt, @mstrokin, @kunal-511, @jahands, and @nathankleyn. Thank you for your contributions!
+Work in this release was contributed by @tjhiggins, @GrizliK1988, @davidturissini, @nwalters512, @aloisklink, @arturovt, @benjick, @maximepvrt, @mstrokin, @kunal-511, @jahands, @jrandolf and @nathankleyn. Thank you for your contributions!
## 9.0.0-alpha.0
From 7a208e17d23edb9c5d0afc7709c46fb9ffffa3e3 Mon Sep 17 00:00:00 2001
From: Lukas Stracke
Date: Mon, 27 Jan 2025 15:26:39 +0100
Subject: [PATCH 17/43] test(e2e): Unflake replay recording data optional e2e
test (#15168)
Relax the assertion for the replay recording data test so that we allow
arbitrary order but still assert on the exact amount and contents of the
received recording items.
closes #15167
---
.../react-send-to-sentry/tests/send-to-sentry.test.ts | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/dev-packages/e2e-tests/test-applications/react-send-to-sentry/tests/send-to-sentry.test.ts b/dev-packages/e2e-tests/test-applications/react-send-to-sentry/tests/send-to-sentry.test.ts
index d9c3e09f2ad2..dc33d271bc18 100644
--- a/dev-packages/e2e-tests/test-applications/react-send-to-sentry/tests/send-to-sentry.test.ts
+++ b/dev-packages/e2e-tests/test-applications/react-send-to-sentry/tests/send-to-sentry.test.ts
@@ -190,7 +190,7 @@ test('Sends a Replay recording to Sentry', async ({ browser }) => {
if (response.ok) {
const data = await response.json();
- return data[0];
+ return { data: data[0], length: data[0].length };
}
return response.status;
@@ -199,5 +199,6 @@ test('Sends a Replay recording to Sentry', async ({ browser }) => {
timeout: EVENT_POLLING_TIMEOUT,
},
)
- .toEqual(ReplayRecordingData);
+ // Check that that all expected data is present but relax the order to avoid flakes
+ .toEqual({ data: expect.arrayContaining(ReplayRecordingData), length: ReplayRecordingData.length });
});
From a0c126b954ab2e7e3a13543ce04924e5d3162681 Mon Sep 17 00:00:00 2001
From: Lukas Stracke
Date: Mon, 27 Jan 2025 16:46:13 +0100
Subject: [PATCH 18/43] test(e2e/nextjs): Avoid making request to example.com
(#15170)
example.com still seems flaky, let's avoid making requests to it
---
.../nextjs-14/app/request-instrumentation/page.tsx | 4 ++--
.../nextjs-14/tests/request-instrumentation.test.ts | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/dev-packages/e2e-tests/test-applications/nextjs-14/app/request-instrumentation/page.tsx b/dev-packages/e2e-tests/test-applications/nextjs-14/app/request-instrumentation/page.tsx
index 0d877296cced..c73e6f79db00 100644
--- a/dev-packages/e2e-tests/test-applications/nextjs-14/app/request-instrumentation/page.tsx
+++ b/dev-packages/e2e-tests/test-applications/nextjs-14/app/request-instrumentation/page.tsx
@@ -3,9 +3,9 @@ import https from 'https';
export const dynamic = 'force-dynamic';
export default async function Page() {
- await fetch('https://example.com/', { cache: 'no-cache' }).then(res => res.text());
+ await fetch('https://github.com/', { cache: 'no-cache' }).then(res => res.text());
await new Promise(resolve => {
- https.get('https://example.com/', res => {
+ https.get('https://github.com/', res => {
res.on('data', () => {
// Noop consuming some data so that request can close :)
});
diff --git a/dev-packages/e2e-tests/test-applications/nextjs-14/tests/request-instrumentation.test.ts b/dev-packages/e2e-tests/test-applications/nextjs-14/tests/request-instrumentation.test.ts
index d26d4e871b6e..2446ffa68659 100644
--- a/dev-packages/e2e-tests/test-applications/nextjs-14/tests/request-instrumentation.test.ts
+++ b/dev-packages/e2e-tests/test-applications/nextjs-14/tests/request-instrumentation.test.ts
@@ -19,7 +19,7 @@ test('Should send a transaction with a fetch span', async ({ page }) => {
'sentry.op': 'http.client',
'sentry.origin': 'auto.http.otel.node_fetch',
}),
- description: 'GET https://example.com/',
+ description: 'GET https://github.com/',
}),
);
@@ -30,7 +30,7 @@ test('Should send a transaction with a fetch span', async ({ page }) => {
'sentry.op': 'http.client',
'sentry.origin': 'auto.http.otel.http',
}),
- description: 'GET https://example.com/',
+ description: 'GET https://github.com/',
}),
);
});
From 6ce53653c19105681784ae4b9d614b69970f5d84 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 27 Jan 2025 15:47:51 +0000
Subject: [PATCH 19/43] feat(deps): bump @sentry/cli from 2.39.1 to 2.41.1
(#15173)
---
packages/remix/package.json | 2 +-
yarn.lock | 95 +++++++++++++++++++++++++++++++++++--
2 files changed, 91 insertions(+), 6 deletions(-)
diff --git a/packages/remix/package.json b/packages/remix/package.json
index 6c88c8f08797..c40305ee8140 100644
--- a/packages/remix/package.json
+++ b/packages/remix/package.json
@@ -54,7 +54,7 @@
"dependencies": {
"@opentelemetry/api": "^1.9.0",
"@remix-run/router": "1.x",
- "@sentry/cli": "^2.39.1",
+ "@sentry/cli": "^2.41.1",
"@sentry/core": "9.0.0-alpha.0",
"@sentry/node": "9.0.0-alpha.0",
"@sentry/opentelemetry": "9.0.0-alpha.0",
diff --git a/yarn.lock b/yarn.lock
index 2e69bdb6d480..d80fe6f3225e 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -6612,37 +6612,72 @@
resolved "https://registry.yarnpkg.com/@sentry/cli-darwin/-/cli-darwin-2.39.1.tgz#75c338a53834b4cf72f57599f4c72ffb36cf0781"
integrity sha512-kiNGNSAkg46LNGatfNH5tfsmI/kCAaPA62KQuFZloZiemTNzhy9/6NJP8HZ/GxGs8GDMxic6wNrV9CkVEgFLJQ==
+"@sentry/cli-darwin@2.41.1":
+ version "2.41.1"
+ resolved "https://registry.yarnpkg.com/@sentry/cli-darwin/-/cli-darwin-2.41.1.tgz#ca7e12bf1ad59bc2df35868ae98abc8869108efa"
+ integrity sha512-7pS3pu/SuhE6jOn3wptstAg6B5nUP878O6s+2svT7b5fKNfYUi/6NPK6dAveh2Ca0rwVq40TO4YFJabWMgTpdQ==
+
"@sentry/cli-linux-arm64@2.39.1":
version "2.39.1"
resolved "https://registry.yarnpkg.com/@sentry/cli-linux-arm64/-/cli-linux-arm64-2.39.1.tgz#27db44700c33fcb1e8966257020b43f8494373e6"
integrity sha512-5VbVJDatolDrWOgaffsEM7znjs0cR8bHt9Bq0mStM3tBolgAeSDHE89NgHggfZR+DJ2VWOy4vgCwkObrUD6NQw==
+"@sentry/cli-linux-arm64@2.41.1":
+ version "2.41.1"
+ resolved "https://registry.yarnpkg.com/@sentry/cli-linux-arm64/-/cli-linux-arm64-2.41.1.tgz#948e8af8290418b1562db3531db08e69e39d74bb"
+ integrity sha512-EzYCEnnENBnS5kpNW+2dBcrPZn1MVfywh2joGVQZTpmgDL5YFJ59VOd+K0XuEwqgFI8BSNI14KXZ75s4DD1/Vw==
+
"@sentry/cli-linux-arm@2.39.1":
version "2.39.1"
resolved "https://registry.yarnpkg.com/@sentry/cli-linux-arm/-/cli-linux-arm-2.39.1.tgz#451683fa9a5a60b1359d104ec71334ed16f4b63c"
integrity sha512-DkENbxyRxUrfLnJLXTA4s5UL/GoctU5Cm4ER1eB7XN7p9WsamFJd/yf2KpltkjEyiTuplv0yAbdjl1KX3vKmEQ==
+"@sentry/cli-linux-arm@2.41.1":
+ version "2.41.1"
+ resolved "https://registry.yarnpkg.com/@sentry/cli-linux-arm/-/cli-linux-arm-2.41.1.tgz#1e5fa971ae8dfb3ea5564c8503b4e635ae6aed8a"
+ integrity sha512-wNUvquD6qjOCczvuBGf9OiD29nuQ6yf8zzfyPJa5Bdx1QXuteKsKb6HBrMwuIR3liyuu0duzHd+H/+p1n541Hg==
+
"@sentry/cli-linux-i686@2.39.1":
version "2.39.1"
resolved "https://registry.yarnpkg.com/@sentry/cli-linux-i686/-/cli-linux-i686-2.39.1.tgz#9965a81f97a94e8b6d1d15589e43fee158e35201"
integrity sha512-pXWVoKXCRrY7N8vc9H7mETiV9ZCz+zSnX65JQCzZxgYrayQPJTc+NPRnZTdYdk5RlAupXaFicBI2GwOCRqVRkg==
+"@sentry/cli-linux-i686@2.41.1":
+ version "2.41.1"
+ resolved "https://registry.yarnpkg.com/@sentry/cli-linux-i686/-/cli-linux-i686-2.41.1.tgz#3f01aff314f2ad8fd761f3e6e807a5ec09ae4eb4"
+ integrity sha512-urpQCWrdYnSAsZY3udttuMV88wTJzKZL10xsrp7sjD/Hd+O6qSLVLkxebIlxts70jMLLFHYrQ2bkRg5kKuX6Fg==
+
"@sentry/cli-linux-x64@2.39.1":
version "2.39.1"
resolved "https://registry.yarnpkg.com/@sentry/cli-linux-x64/-/cli-linux-x64-2.39.1.tgz#31fe008b02f92769543dc9919e2a5cbc4cda7889"
integrity sha512-IwayNZy+it7FWG4M9LayyUmG1a/8kT9+/IEm67sT5+7dkMIMcpmHDqL8rWcPojOXuTKaOBBjkVdNMBTXy0mXlA==
+"@sentry/cli-linux-x64@2.41.1":
+ version "2.41.1"
+ resolved "https://registry.yarnpkg.com/@sentry/cli-linux-x64/-/cli-linux-x64-2.41.1.tgz#30dbf966a4b4c1721ffccd901dfcb6f967db073d"
+ integrity sha512-ZqpYwHXAaK4MMEFlyaLYr6mJTmpy9qP6n30jGhLTW7kHKS3s6GPLCSlNmIfeClrInEt0963fM633ZRnXa04VPw==
+
"@sentry/cli-win32-i686@2.39.1":
version "2.39.1"
resolved "https://registry.yarnpkg.com/@sentry/cli-win32-i686/-/cli-win32-i686-2.39.1.tgz#609e8790c49414011445e397130560c777850b35"
integrity sha512-NglnNoqHSmE+Dz/wHeIVRnV2bLMx7tIn3IQ8vXGO5HWA2f8zYJGktbkLq1Lg23PaQmeZLPGlja3gBQfZYSG10Q==
+"@sentry/cli-win32-i686@2.41.1":
+ version "2.41.1"
+ resolved "https://registry.yarnpkg.com/@sentry/cli-win32-i686/-/cli-win32-i686-2.41.1.tgz#f88eeb5d2d4ee46c38d8616ae1eb484108ea71c2"
+ integrity sha512-AuRimCeVsx99DIOr9cwdYBHk39tlmAuPDdy2r16iNzY0InXs4xOys4gGzM7N4vlFQvFkzuc778Su0HkfasgprA==
+
"@sentry/cli-win32-x64@2.39.1":
version "2.39.1"
resolved "https://registry.yarnpkg.com/@sentry/cli-win32-x64/-/cli-win32-x64-2.39.1.tgz#1a874a5570c6d162b35d9d001c96e5389d07d2cb"
integrity sha512-xv0R2CMf/X1Fte3cMWie1NXuHmUyQPDBfCyIt6k6RPFPxAYUgcqgMPznYwVMwWEA1W43PaOkSn3d8ZylsDaETw==
-"@sentry/cli@2.39.1", "@sentry/cli@^2.36.1", "@sentry/cli@^2.39.1":
+"@sentry/cli-win32-x64@2.41.1":
+ version "2.41.1"
+ resolved "https://registry.yarnpkg.com/@sentry/cli-win32-x64/-/cli-win32-x64-2.41.1.tgz#eefd95a2aa184adb464334e265b55a9142070f6f"
+ integrity sha512-6JcPvXGye61+wPp0xdzfc2YLE/Dcud8JdaK8VxLM3b/8+Em7E+UyliDu3uF8+YGUqizY5JYTd3fs17DC8DZhLw==
+
+"@sentry/cli@2.39.1":
version "2.39.1"
resolved "https://registry.yarnpkg.com/@sentry/cli/-/cli-2.39.1.tgz#916bb5b7567ccf7fdf94ef6cf8a2b9ab78370d29"
integrity sha512-JIb3e9vh0+OmQ0KxmexMXg9oZsR/G7HMwxt5BUIKAXZ9m17Xll4ETXTRnRUBT3sf7EpNGAmlQk1xEmVN9pYZYQ==
@@ -6661,6 +6696,25 @@
"@sentry/cli-win32-i686" "2.39.1"
"@sentry/cli-win32-x64" "2.39.1"
+"@sentry/cli@^2.36.1", "@sentry/cli@^2.41.1":
+ version "2.41.1"
+ resolved "https://registry.yarnpkg.com/@sentry/cli/-/cli-2.41.1.tgz#a9467ca3ff4acfcdedec1565c9ff726b93758d29"
+ integrity sha512-0GVmDiTV7R1492wkVY4bGcfC0fSmRmQjuxaaPI8CIV9B2VP9pBVCUizi1mevXaaE4I3fM60LI+XYrKFEneuVog==
+ dependencies:
+ https-proxy-agent "^5.0.0"
+ node-fetch "^2.6.7"
+ progress "^2.0.3"
+ proxy-from-env "^1.1.0"
+ which "^2.0.2"
+ optionalDependencies:
+ "@sentry/cli-darwin" "2.41.1"
+ "@sentry/cli-linux-arm" "2.41.1"
+ "@sentry/cli-linux-arm64" "2.41.1"
+ "@sentry/cli-linux-i686" "2.41.1"
+ "@sentry/cli-linux-x64" "2.41.1"
+ "@sentry/cli-win32-i686" "2.41.1"
+ "@sentry/cli-win32-x64" "2.41.1"
+
"@sentry/rollup-plugin@2.22.7":
version "2.22.7"
resolved "https://registry.yarnpkg.com/@sentry/rollup-plugin/-/rollup-plugin-2.22.7.tgz#994bb859437eb1e5fd34c485aaa79ba14354778f"
@@ -7890,7 +7944,12 @@
dependencies:
"@types/unist" "*"
-"@types/history-4@npm:@types/history@4.7.8", "@types/history-5@npm:@types/history@4.7.8":
+"@types/history-4@npm:@types/history@4.7.8":
+ version "4.7.8"
+ resolved "https://registry.yarnpkg.com/@types/history/-/history-4.7.8.tgz#49348387983075705fe8f4e02fb67f7daaec4934"
+ integrity sha512-S78QIYirQcUoo6UJZx9CSP0O2ix9IaeAXwQi26Rhr/+mg7qqPy8TzaxHSUut7eGjL8WmLccT7/MXf304WjqHcA==
+
+"@types/history-5@npm:@types/history@4.7.8":
version "4.7.8"
resolved "https://registry.yarnpkg.com/@types/history/-/history-4.7.8.tgz#49348387983075705fe8f4e02fb67f7daaec4934"
integrity sha512-S78QIYirQcUoo6UJZx9CSP0O2ix9IaeAXwQi26Rhr/+mg7qqPy8TzaxHSUut7eGjL8WmLccT7/MXf304WjqHcA==
@@ -27421,7 +27480,16 @@ string-template@~0.2.1:
resolved "https://registry.yarnpkg.com/string-template/-/string-template-0.2.1.tgz#42932e598a352d01fc22ec3367d9d84eec6c9add"
integrity sha1-QpMuWYo1LQH8IuwzZ9nYTuxsmt0=
-"string-width-cjs@npm:string-width@^4.2.0", string-width@4.2.3, "string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.2, string-width@^4.2.3:
+"string-width-cjs@npm:string-width@^4.2.0":
+ version "4.2.3"
+ resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
+ integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
+ dependencies:
+ emoji-regex "^8.0.0"
+ is-fullwidth-code-point "^3.0.0"
+ strip-ansi "^6.0.1"
+
+string-width@4.2.3, "string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.2, string-width@^4.2.3:
version "4.2.3"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
@@ -27524,7 +27592,14 @@ stringify-object@^3.2.1:
is-obj "^1.0.1"
is-regexp "^1.0.0"
-"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@6.0.1, strip-ansi@^6.0.0, strip-ansi@^6.0.1:
+"strip-ansi-cjs@npm:strip-ansi@^6.0.1":
+ version "6.0.1"
+ resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
+ integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
+ dependencies:
+ ansi-regex "^5.0.1"
+
+strip-ansi@6.0.1, strip-ansi@^6.0.0, strip-ansi@^6.0.1:
version "6.0.1"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
@@ -27689,6 +27764,7 @@ stylus@0.59.0, stylus@^0.59.0:
sucrase@^3.27.0, sucrase@^3.35.0, sucrase@getsentry/sucrase#es2020-polyfills:
version "3.36.0"
+ uid fd682f6129e507c00bb4e6319cc5d6b767e36061
resolved "https://codeload.github.com/getsentry/sucrase/tar.gz/fd682f6129e507c00bb4e6319cc5d6b767e36061"
dependencies:
"@jridgewell/gen-mapping" "^0.3.2"
@@ -30314,7 +30390,16 @@ wrangler@^3.67.1:
optionalDependencies:
fsevents "~2.3.2"
-"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@7.0.0, wrap-ansi@^7.0.0:
+"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0":
+ version "7.0.0"
+ resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
+ integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
+ dependencies:
+ ansi-styles "^4.0.0"
+ string-width "^4.1.0"
+ strip-ansi "^6.0.0"
+
+wrap-ansi@7.0.0, wrap-ansi@^7.0.0:
version "7.0.0"
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
From 5ef37773fb9bb8c9baa929a1eddab59fcaf1c6c9 Mon Sep 17 00:00:00 2001
From: chris-basebone <100691954+chris-basebone@users.noreply.github.com>
Date: Tue, 28 Jan 2025 09:48:22 +0200
Subject: [PATCH 20/43] feat(nuxt): Add `url` to `SourcemapsUploadOptions`
(#15171)
---------
Co-authored-by: Lukas Stracke
---
packages/nuxt/src/common/types.ts | 7 +++++++
packages/nuxt/src/vite/sourceMaps.ts | 1 +
packages/nuxt/test/vite/sourceMaps.test.ts | 5 +++++
3 files changed, 13 insertions(+)
diff --git a/packages/nuxt/src/common/types.ts b/packages/nuxt/src/common/types.ts
index 93ca94016924..8a9a453ff7db 100644
--- a/packages/nuxt/src/common/types.ts
+++ b/packages/nuxt/src/common/types.ts
@@ -32,6 +32,13 @@ type SourceMapsOptions = {
*/
org?: string;
+ /**
+ * The URL of your Sentry instance if you're using self-hosted Sentry.
+ *
+ * @default https://sentry.io by default the plugin will point towards the Sentry SaaS URL
+ */
+ url?: string;
+
/**
* The project slug of your Sentry project.
* Instead of specifying this option, you can also set the `SENTRY_PROJECT` environment variable.
diff --git a/packages/nuxt/src/vite/sourceMaps.ts b/packages/nuxt/src/vite/sourceMaps.ts
index 2f90094e6138..0b264e822bcc 100644
--- a/packages/nuxt/src/vite/sourceMaps.ts
+++ b/packages/nuxt/src/vite/sourceMaps.ts
@@ -91,6 +91,7 @@ export function getPluginOptions(
project: sourceMapsUploadOptions.project ?? process.env.SENTRY_PROJECT,
authToken: sourceMapsUploadOptions.authToken ?? process.env.SENTRY_AUTH_TOKEN,
telemetry: sourceMapsUploadOptions.telemetry ?? true,
+ url: sourceMapsUploadOptions.url ?? process.env.SENTRY_URL,
debug: moduleOptions.debug ?? false,
_metaOptions: {
telemetry: {
diff --git a/packages/nuxt/test/vite/sourceMaps.test.ts b/packages/nuxt/test/vite/sourceMaps.test.ts
index 0c90429fa8d5..b33d314f5166 100644
--- a/packages/nuxt/test/vite/sourceMaps.test.ts
+++ b/packages/nuxt/test/vite/sourceMaps.test.ts
@@ -20,6 +20,7 @@ describe('getPluginOptions', () => {
SENTRY_ORG: 'default-org',
SENTRY_PROJECT: 'default-project',
SENTRY_AUTH_TOKEN: 'default-token',
+ SENTRY_URL: 'https://santry.io',
};
process.env = { ...defaultEnv };
@@ -31,6 +32,7 @@ describe('getPluginOptions', () => {
org: 'default-org',
project: 'default-project',
authToken: 'default-token',
+ url: 'https://santry.io',
telemetry: true,
sourcemaps: expect.objectContaining({
rewriteSources: expect.any(Function),
@@ -114,6 +116,7 @@ describe('getPluginOptions', () => {
assets: ['custom-assets/**/*'],
filesToDeleteAfterUpload: ['delete-this.js'],
},
+ url: 'https://santry.io',
},
debug: true,
unstable_sentryBundlerPluginOptions: {
@@ -124,6 +127,7 @@ describe('getPluginOptions', () => {
release: {
name: 'test-release',
},
+ url: 'https://suntry.io',
},
};
const options = getPluginOptions(customOptions, false);
@@ -140,6 +144,7 @@ describe('getPluginOptions', () => {
release: expect.objectContaining({
name: 'test-release',
}),
+ url: 'https://suntry.io',
}),
);
});
From 3a1006ea49d2aa67c27f917c30aceae16cf01eef Mon Sep 17 00:00:00 2001
From: Daniel Griesser
Date: Tue, 28 Jan 2025 08:58:36 +0100
Subject: [PATCH 21/43] chore: Add external contributor to CHANGELOG.md
(#15203)
---------
Co-authored-by: Lukas Stracke
---
CHANGELOG.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index a30b5747e9dc..ad2232acfbb1 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -10,7 +10,7 @@
- "You miss 100 percent of the chances you don't take. — Wayne Gretzky" — Michael Scott
-Work in this release was contributed by @tjhiggins, @GrizliK1988, @davidturissini, @nwalters512, @aloisklink, @arturovt, @benjick, @maximepvrt, @mstrokin, @kunal-511, @jahands, @jrandolf and @nathankleyn. Thank you for your contributions!
+Work in this release was contributed by @tjhiggins, @chris-basebone, @GrizliK1988, @davidturissini, @nwalters512, @aloisklink, @arturovt, @benjick, @maximepvrt, @mstrokin, @kunal-511, @jahands, @jrandolf and @nathankleyn. Thank you for your contributions!
## 9.0.0-alpha.0
From 76b5c33173157bcf3b1997135f0c1fc54f021abf Mon Sep 17 00:00:00 2001
From: Luca Forstner
Date: Tue, 28 Jan 2025 16:51:30 +0100
Subject: [PATCH 22/43] test: Fix nextjs build warning (#15207)
---
.../e2e-tests/test-applications/nextjs-app-dir/assert-build.ts | 2 +-
packages/nextjs/src/config/webpack.ts | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/dev-packages/e2e-tests/test-applications/nextjs-app-dir/assert-build.ts b/dev-packages/e2e-tests/test-applications/nextjs-app-dir/assert-build.ts
index 955988101724..70564e0c12bb 100644
--- a/dev-packages/e2e-tests/test-applications/nextjs-app-dir/assert-build.ts
+++ b/dev-packages/e2e-tests/test-applications/nextjs-app-dir/assert-build.ts
@@ -10,7 +10,7 @@ const buildStderr = fs.readFileSync('.tmp_build_stderr', 'utf-8');
// Assert that there was no funky build time warning when we are on a stable (pinned) version
if (nextjsVersion !== 'latest' && !nextjsVersion.includes('-canary') && !nextjsVersion.includes('-rc')) {
- assert.doesNotMatch(buildStderr, /Import trace for requested module/); // This is Next.js/Webpack speech for "something is off"
+ assert.doesNotMatch(buildStderr, /Import trace for requested module/, `Build warning in output:\n${buildStderr}`); // This is Next.js/Webpack speech for "something is off"
}
// Assert that all static components stay static and all dynamic components stay dynamic
diff --git a/packages/nextjs/src/config/webpack.ts b/packages/nextjs/src/config/webpack.ts
index 8dbebf3935df..f82bb4a0476e 100644
--- a/packages/nextjs/src/config/webpack.ts
+++ b/packages/nextjs/src/config/webpack.ts
@@ -728,6 +728,7 @@ function addOtelWarningIgnoreRule(newConfig: WebpackConfigObjectWithModuleRules)
// We provide these objects in addition to the hook above to provide redundancy in case the hook fails.
{ module: /@opentelemetry\/instrumentation/, message: /Critical dependency/ },
{ module: /@prisma\/instrumentation/, message: /Critical dependency/ },
+ { module: /require-in-the-middle/, message: /Critical dependency/ },
] satisfies IgnoreWarningsOption;
if (newConfig.ignoreWarnings === undefined) {
From a27652f09538e91d3c6c23f8eeadb75743067428 Mon Sep 17 00:00:00 2001
From: Francesco Gringl-Novy
Date: Tue, 28 Jan 2025 17:59:05 +0100
Subject: [PATCH 23/43] chore(deps): Update playwright to 1.50.0 (#15164)
Also align to use the same version everywhere, tilde-restricted.
---
.github/workflows/build.yml | 2 +-
.../browser-integration-tests/package.json | 3 +-
.../scripts/detectFlakyTests.ts | 49 ++----
.../onError/syntax-errors/test.ts | 2 +-
.../test.ts-snapshots/seg-0-snap-full | 113 -------------
.../test.ts-snapshots/seg-1-snap-incremental | 45 -----
.../seg-1-snap-incremental-chromium | 4 +-
.../test.ts-snapshots/seg-2-snap-full | 113 -------------
.../test.ts-snapshots/seg-3-snap-incremental | 45 -----
.../seg-3-snap-incremental-chromium | 4 +-
.../test.ts-snapshots/seg-4-snap-full | 156 ------------------
.../test.ts-snapshots/seg-5-snap-incremental | 45 -----
.../test.ts-snapshots/seg-6-snap-incremental | 54 ------
.../test.ts-snapshots/seg-7-snap-incremental | 54 ------
.../test.ts-snapshots/seg-8-snap-full | 113 -------------
.../test.ts-snapshots/seg-9-snap-incremental | 45 -----
.../seg-9-snap-incremental-chromium | 4 +-
.../suites/replay/sessionExpiry/test.ts | 2 +-
.../test.ts-snapshots/snapshot-0-webkit.json | 113 -------------
.../test.ts-snapshots/snapshot-2-webkit.json | 127 --------------
.../suites/stacktraces/init.js | 6 +
.../suites/stacktraces/template.html | 2 -
.../http-timings/init.js | 6 +
.../interactions/init.js | 6 +
.../long-animation-frame-enabled/test.ts | 9 +-
.../test.ts | 9 +-
.../tracing/metrics/web-vitals-lcp/test.ts | 53 +-----
.../test-applications/angular-17/package.json | 2 +-
.../test-applications/angular-18/package.json | 2 +-
.../test-applications/angular-19/package.json | 2 +-
.../test-applications/astro-4/package.json | 2 +-
.../test-applications/astro-5/package.json | 2 +-
.../aws-lambda-layer-cjs/package.json | 2 +-
.../aws-serverless-esm/package.json | 2 +-
.../create-next-app/package.json | 2 +-
.../package.json | 2 +-
.../create-remix-app-express/package.json | 2 +-
.../create-remix-app-v2/package.json | 2 +-
.../default-browser/package.json | 2 +-
.../ember-classic/package.json | 2 +-
.../ember-embroider/package.json | 2 +-
.../test-applications/nestjs-8/package.json | 2 +-
.../nestjs-basic-with-graphql/package.json | 2 +-
.../nestjs-basic/package.json | 2 +-
.../nestjs-distributed-tracing/package.json | 2 +-
.../nestjs-fastify/package.json | 2 +-
.../nestjs-graphql/package.json | 2 +-
.../package.json | 2 +-
.../nestjs-with-submodules/package.json | 2 +-
.../test-applications/nextjs-13/package.json | 2 +-
.../test-applications/nextjs-14/package.json | 2 +-
.../test-applications/nextjs-15/package.json | 2 +-
.../nextjs-app-dir/package.json | 2 +-
.../test-applications/nextjs-t3/package.json | 2 +-
.../nextjs-turbo/package.json | 2 +-
.../node-connect/package.json | 2 +-
.../node-express-cjs-preload/package.json | 2 +-
.../node-express-esm-loader/package.json | 2 +-
.../node-express-esm-preload/package.json | 2 +-
.../package.json | 2 +-
.../package.json | 2 +-
.../node-express-send-to-sentry/package.json | 2 +-
.../node-express/package.json | 2 +-
.../node-fastify-5/package.json | 2 +-
.../node-fastify/package.json | 2 +-
.../test-applications/node-hapi/package.json | 2 +-
.../test-applications/node-koa/package.json | 2 +-
.../node-otel-custom-sampler/package.json | 2 +-
.../node-otel-sdk-node/package.json | 2 +-
.../node-otel-without-tracing/package.json | 2 +-
.../test-applications/node-otel/package.json | 2 +-
.../node-profiling/package.json | 2 +-
.../nuxt-3-dynamic-import/package.json | 2 +-
.../test-applications/nuxt-3-min/package.json | 2 +-
.../nuxt-3-top-level-import/package.json | 2 +-
.../test-applications/nuxt-3/package.json | 2 +-
.../test-applications/nuxt-4/package.json | 2 +-
.../test-applications/react-17/package.json | 2 +-
.../test-applications/react-19/package.json | 2 +-
.../react-create-browser-router/package.json | 2 +-
.../react-create-hash-router/package.json | 2 +-
.../react-create-memory-router/package.json | 2 +-
.../react-router-5/package.json | 2 +-
.../package.json | 2 +-
.../react-router-6-use-routes/package.json | 2 +-
.../react-router-6/package.json | 2 +-
.../react-router-7-spa/package.json | 2 +-
.../react-send-to-sentry/package.json | 2 +-
.../solid-solidrouter/package.json | 2 +-
.../test-applications/solid/package.json | 2 +-
.../solidstart-dynamic-import/package.json | 2 +-
.../solidstart-spa/package.json | 2 +-
.../solidstart-top-level-import/package.json | 2 +-
.../test-applications/solidstart/package.json | 2 +-
.../test-applications/svelte-5/package.json | 2 +-
.../sveltekit-2-svelte-5/package.json | 2 +-
.../sveltekit-2-twp/package.json | 2 +-
.../sveltekit-2/package.json | 2 +-
.../tanstack-router/package.json | 2 +-
.../test-applications/vue-3/package.json | 2 +-
.../test-applications/webpack-4/package.json | 2 +-
.../test-applications/webpack-5/package.json | 2 +-
dev-packages/test-utils/package.json | 4 +-
packages/browser/src/transports/fetch.ts | 2 +-
.../browser/src/utils/lazyLoadIntegration.ts | 2 +-
.../browser/test/transports/fetch.test.ts | 2 +-
packages/deno/src/transports/index.ts | 2 +-
yarn.lock | 28 ++--
108 files changed, 148 insertions(+), 1226 deletions(-)
delete mode 100644 dev-packages/browser-integration-tests/suites/replay/multiple-pages/test.ts-snapshots/seg-0-snap-full
delete mode 100644 dev-packages/browser-integration-tests/suites/replay/multiple-pages/test.ts-snapshots/seg-1-snap-incremental
delete mode 100644 dev-packages/browser-integration-tests/suites/replay/multiple-pages/test.ts-snapshots/seg-2-snap-full
delete mode 100644 dev-packages/browser-integration-tests/suites/replay/multiple-pages/test.ts-snapshots/seg-3-snap-incremental
delete mode 100644 dev-packages/browser-integration-tests/suites/replay/multiple-pages/test.ts-snapshots/seg-4-snap-full
delete mode 100644 dev-packages/browser-integration-tests/suites/replay/multiple-pages/test.ts-snapshots/seg-5-snap-incremental
delete mode 100644 dev-packages/browser-integration-tests/suites/replay/multiple-pages/test.ts-snapshots/seg-6-snap-incremental
delete mode 100644 dev-packages/browser-integration-tests/suites/replay/multiple-pages/test.ts-snapshots/seg-7-snap-incremental
delete mode 100644 dev-packages/browser-integration-tests/suites/replay/multiple-pages/test.ts-snapshots/seg-8-snap-full
delete mode 100644 dev-packages/browser-integration-tests/suites/replay/multiple-pages/test.ts-snapshots/seg-9-snap-incremental
delete mode 100644 dev-packages/browser-integration-tests/suites/replay/sessionExpiry/test.ts-snapshots/snapshot-0-webkit.json
delete mode 100644 dev-packages/browser-integration-tests/suites/replay/sessionExpiry/test.ts-snapshots/snapshot-2-webkit.json
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 24f3ee0454f2..34bb9eb5799f 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -600,7 +600,7 @@ jobs:
env:
PW_BUNDLE: ${{ matrix.bundle }}
working-directory: dev-packages/browser-integration-tests
- run: yarn test:ci${{ matrix.project && format(' --project={0}', matrix.project) || '' }}${{ matrix.shard && format(' --shard={0}/{1}', matrix.shard, matrix.shards) || '' }}
+ run: yarn test:all${{ matrix.project && format(' --project={0}', matrix.project) || '' }}${{ matrix.shard && format(' --shard={0}/{1}', matrix.shard, matrix.shards) || '' }}
- name: Upload Playwright Traces
uses: actions/upload-artifact@v4
diff --git a/dev-packages/browser-integration-tests/package.json b/dev-packages/browser-integration-tests/package.json
index bfd1ed3d2717..77cf36078a2a 100644
--- a/dev-packages/browser-integration-tests/package.json
+++ b/dev-packages/browser-integration-tests/package.json
@@ -35,13 +35,12 @@
"test:loader:replay_buffer": "PW_BUNDLE=loader_replay_buffer yarn test:loader",
"test:loader:full": "PW_BUNDLE=loader_tracing_replay yarn test:loader",
"test:loader:debug": "PW_BUNDLE=loader_debug yarn test:loader",
- "test:ci": "yarn test:all",
"test:update-snapshots": "yarn test:all --update-snapshots",
"test:detect-flaky": "ts-node scripts/detectFlakyTests.ts"
},
"dependencies": {
"@babel/preset-typescript": "^7.16.7",
- "@playwright/test": "^1.44.1",
+ "@playwright/test": "~1.50.0",
"@sentry-internal/rrweb": "2.31.0",
"@sentry/browser": "9.0.0-alpha.0",
"axios": "1.7.7",
diff --git a/dev-packages/browser-integration-tests/scripts/detectFlakyTests.ts b/dev-packages/browser-integration-tests/scripts/detectFlakyTests.ts
index bf653dfad6b7..6fa8e8ddd416 100644
--- a/dev-packages/browser-integration-tests/scripts/detectFlakyTests.ts
+++ b/dev-packages/browser-integration-tests/scripts/detectFlakyTests.ts
@@ -4,14 +4,9 @@ import * as path from 'path';
import * as glob from 'glob';
/**
- * The number of browsers we run the tests in.
+ * Assume that each test runs for 3s.
*/
-const NUM_BROWSERS = 3;
-
-/**
- * Assume that each test runs for 2s.
- */
-const ASSUMED_TEST_DURATION_SECONDS = 2;
+const ASSUMED_TEST_DURATION_SECONDS = 3;
/**
* We keep the runtime of the detector if possible under 30min.
@@ -51,22 +46,12 @@ ${changedPaths.join('\n')}
try {
await new Promise((resolve, reject) => {
const cp = childProcess.spawn(
- `npx playwright test ${
- testPaths.length ? testPaths.join(' ') : './suites'
- } --reporter='line' --repeat-each ${repeatEachCount}`,
- { shell: true, cwd },
+ `npx playwright test ${testPaths.length ? testPaths.join(' ') : './suites'} --repeat-each ${repeatEachCount}`,
+ { shell: true, cwd, stdio: 'inherit' },
);
let error: Error | undefined;
- cp.stdout.on('data', data => {
- console.log(data ? (data as object).toString() : '');
- });
-
- cp.stderr.on('data', data => {
- console.log(data ? (data as object).toString() : '');
- });
-
cp.on('error', e => {
console.error(e);
error = e;
@@ -107,15 +92,16 @@ function getPerTestRunCount(testPaths: string[]) {
const estimatedNumberOfTests = testPaths.map(getApproximateNumberOfTests).reduce((a, b) => a + b);
console.log(`Estimated number of tests: ${estimatedNumberOfTests}`);
- // tests are usually run against all browsers we test with, so let's assume this
- const testRunCount = estimatedNumberOfTests * NUM_BROWSERS;
+ const testRunCount = estimatedNumberOfTests;
console.log(`Estimated test runs for one round: ${testRunCount}`);
const estimatedTestRuntime = testRunCount * ASSUMED_TEST_DURATION_SECONDS;
console.log(`Estimated test runtime: ${estimatedTestRuntime}s`);
const expectedPerTestRunCount = Math.floor(MAX_TARGET_TEST_RUNTIME_SECONDS / estimatedTestRuntime);
- console.log(`Expected per-test run count: ${expectedPerTestRunCount}`);
+ console.log(
+ `Calculated # of repetitions: ${expectedPerTestRunCount} (min ${MIN_PER_TEST_RUN_COUNT}, max ${MAX_PER_TEST_RUN_COUNT})`,
+ );
return Math.min(MAX_PER_TEST_RUN_COUNT, Math.max(expectedPerTestRunCount, MIN_PER_TEST_RUN_COUNT));
}
@@ -128,22 +114,7 @@ function getTestPaths(): string[] {
cwd: path.join(__dirname, '../'),
});
- return paths.map(p => path.dirname(p));
-}
-
-function logError(error: unknown) {
- if (process.env.CI) {
- console.log('::group::Test failed');
- } else {
- console.error(' ⚠️ Test failed:');
- }
-
- console.log((error as any).stdout);
- console.log((error as any).stderr);
-
- if (process.env.CI) {
- console.log('::endgroup::');
- }
+ return paths.map(p => `${path.dirname(p)}/`);
}
/**
@@ -156,7 +127,7 @@ function logError(error: unknown) {
function getApproximateNumberOfTests(testPath: string): number {
try {
const content = fs.readFileSync(path.join(process.cwd(), testPath, 'test.ts'), 'utf-8');
- const matches = content.match(/it\(|test\(|sentryTest\(/g);
+ const matches = content.match(/sentryTest\(/g);
return Math.max(matches ? matches.length : 1, 1);
} catch (e) {
console.error(`Could not read file ${testPath}`);
diff --git a/dev-packages/browser-integration-tests/suites/public-api/instrumentation/onError/syntax-errors/test.ts b/dev-packages/browser-integration-tests/suites/public-api/instrumentation/onError/syntax-errors/test.ts
index c11d1897e1c2..51ac86e0cf62 100644
--- a/dev-packages/browser-integration-tests/suites/public-api/instrumentation/onError/syntax-errors/test.ts
+++ b/dev-packages/browser-integration-tests/suites/public-api/instrumentation/onError/syntax-errors/test.ts
@@ -27,7 +27,7 @@ sentryTest('should catch syntax errors', async ({ getLocalTestUrl, page, browser
expect(eventData.exception?.values).toHaveLength(1);
expect(eventData.exception?.values?.[0]).toMatchObject({
type: 'SyntaxError',
- value: "Unexpected token '{'",
+ value: "Failed to execute 'appendChild' on 'Node': Unexpected token '{'",
mechanism: {
type: 'onerror',
handled: false,
diff --git a/dev-packages/browser-integration-tests/suites/replay/multiple-pages/test.ts-snapshots/seg-0-snap-full b/dev-packages/browser-integration-tests/suites/replay/multiple-pages/test.ts-snapshots/seg-0-snap-full
deleted file mode 100644
index 0d77b67cb862..000000000000
--- a/dev-packages/browser-integration-tests/suites/replay/multiple-pages/test.ts-snapshots/seg-0-snap-full
+++ /dev/null
@@ -1,113 +0,0 @@
-[
- {
- "type": 2,
- "data": {
- "node": {
- "type": 0,
- "childNodes": [
- {
- "type": 1,
- "name": "html",
- "publicId": "",
- "systemId": "",
- "id": 2
- },
- {
- "type": 2,
- "tagName": "html",
- "attributes": {},
- "childNodes": [
- {
- "type": 2,
- "tagName": "head",
- "attributes": {},
- "childNodes": [
- {
- "type": 2,
- "tagName": "meta",
- "attributes": {
- "charset": "utf-8"
- },
- "childNodes": [],
- "id": 5
- }
- ],
- "id": 4
- },
- {
- "type": 3,
- "textContent": "\n ",
- "id": 6
- },
- {
- "type": 2,
- "tagName": "body",
- "attributes": {},
- "childNodes": [
- {
- "type": 3,
- "textContent": "\n ",
- "id": 8
- },
- {
- "type": 2,
- "tagName": "button",
- "attributes": {
- "id": "go-background"
- },
- "childNodes": [
- {
- "type": 3,
- "textContent": "*** ***",
- "id": 10
- }
- ],
- "id": 9
- },
- {
- "type": 3,
- "textContent": "\n ",
- "id": 11
- },
- {
- "type": 2,
- "tagName": "a",
- "attributes": {
- "href": "http://sentry-test.io/page-0.html"
- },
- "childNodes": [
- {
- "type": 3,
- "textContent": "** ** *** ****",
- "id": 13
- }
- ],
- "id": 12
- },
- {
- "type": 3,
- "textContent": "\n ",
- "id": 14
- },
- {
- "type": 3,
- "textContent": "\n\n",
- "id": 15
- }
- ],
- "id": 7
- }
- ],
- "id": 3
- }
- ],
- "id": 1
- },
- "initialOffset": {
- "left": 0,
- "top": 0
- }
- },
- "timestamp": [timestamp]
- }
-]
diff --git a/dev-packages/browser-integration-tests/suites/replay/multiple-pages/test.ts-snapshots/seg-1-snap-incremental b/dev-packages/browser-integration-tests/suites/replay/multiple-pages/test.ts-snapshots/seg-1-snap-incremental
deleted file mode 100644
index 02a3e3f893d6..000000000000
--- a/dev-packages/browser-integration-tests/suites/replay/multiple-pages/test.ts-snapshots/seg-1-snap-incremental
+++ /dev/null
@@ -1,45 +0,0 @@
-[
- {
- "type": 3,
- "data": {
- "source": 2,
- "type": 1,
- "id": 9,
- "x": 41.810001373291016,
- "y": 18.479999542236328
- },
- "timestamp": [timestamp]
- },
- {
- "type": 3,
- "data": {
- "source": 2,
- "type": 5,
- "id": 9
- },
- "timestamp": [timestamp]
- },
- {
- "type": 3,
- "data": {
- "source": 2,
- "type": 0,
- "id": 9,
- "x": 41.810001373291016,
- "y": 18.479999542236328
- },
- "timestamp": [timestamp]
- },
- {
- "type": 3,
- "data": {
- "source": 2,
- "type": 2,
- "id": 9,
- "x": 41,
- "y": 18,
- "pointerType": 0
- },
- "timestamp": [timestamp]
- }
-]
\ No newline at end of file
diff --git a/dev-packages/browser-integration-tests/suites/replay/multiple-pages/test.ts-snapshots/seg-1-snap-incremental-chromium b/dev-packages/browser-integration-tests/suites/replay/multiple-pages/test.ts-snapshots/seg-1-snap-incremental-chromium
index 02a3e3f893d6..4e76cedf3b0c 100644
--- a/dev-packages/browser-integration-tests/suites/replay/multiple-pages/test.ts-snapshots/seg-1-snap-incremental-chromium
+++ b/dev-packages/browser-integration-tests/suites/replay/multiple-pages/test.ts-snapshots/seg-1-snap-incremental-chromium
@@ -6,7 +6,7 @@
"type": 1,
"id": 9,
"x": 41.810001373291016,
- "y": 18.479999542236328
+ "y": 18.5
},
"timestamp": [timestamp]
},
@@ -26,7 +26,7 @@
"type": 0,
"id": 9,
"x": 41.810001373291016,
- "y": 18.479999542236328
+ "y": 18.5
},
"timestamp": [timestamp]
},
diff --git a/dev-packages/browser-integration-tests/suites/replay/multiple-pages/test.ts-snapshots/seg-2-snap-full b/dev-packages/browser-integration-tests/suites/replay/multiple-pages/test.ts-snapshots/seg-2-snap-full
deleted file mode 100644
index 0d77b67cb862..000000000000
--- a/dev-packages/browser-integration-tests/suites/replay/multiple-pages/test.ts-snapshots/seg-2-snap-full
+++ /dev/null
@@ -1,113 +0,0 @@
-[
- {
- "type": 2,
- "data": {
- "node": {
- "type": 0,
- "childNodes": [
- {
- "type": 1,
- "name": "html",
- "publicId": "",
- "systemId": "",
- "id": 2
- },
- {
- "type": 2,
- "tagName": "html",
- "attributes": {},
- "childNodes": [
- {
- "type": 2,
- "tagName": "head",
- "attributes": {},
- "childNodes": [
- {
- "type": 2,
- "tagName": "meta",
- "attributes": {
- "charset": "utf-8"
- },
- "childNodes": [],
- "id": 5
- }
- ],
- "id": 4
- },
- {
- "type": 3,
- "textContent": "\n ",
- "id": 6
- },
- {
- "type": 2,
- "tagName": "body",
- "attributes": {},
- "childNodes": [
- {
- "type": 3,
- "textContent": "\n ",
- "id": 8
- },
- {
- "type": 2,
- "tagName": "button",
- "attributes": {
- "id": "go-background"
- },
- "childNodes": [
- {
- "type": 3,
- "textContent": "*** ***",
- "id": 10
- }
- ],
- "id": 9
- },
- {
- "type": 3,
- "textContent": "\n ",
- "id": 11
- },
- {
- "type": 2,
- "tagName": "a",
- "attributes": {
- "href": "http://sentry-test.io/page-0.html"
- },
- "childNodes": [
- {
- "type": 3,
- "textContent": "** ** *** ****",
- "id": 13
- }
- ],
- "id": 12
- },
- {
- "type": 3,
- "textContent": "\n ",
- "id": 14
- },
- {
- "type": 3,
- "textContent": "\n\n",
- "id": 15
- }
- ],
- "id": 7
- }
- ],
- "id": 3
- }
- ],
- "id": 1
- },
- "initialOffset": {
- "left": 0,
- "top": 0
- }
- },
- "timestamp": [timestamp]
- }
-]
diff --git a/dev-packages/browser-integration-tests/suites/replay/multiple-pages/test.ts-snapshots/seg-3-snap-incremental b/dev-packages/browser-integration-tests/suites/replay/multiple-pages/test.ts-snapshots/seg-3-snap-incremental
deleted file mode 100644
index 02a3e3f893d6..000000000000
--- a/dev-packages/browser-integration-tests/suites/replay/multiple-pages/test.ts-snapshots/seg-3-snap-incremental
+++ /dev/null
@@ -1,45 +0,0 @@
-[
- {
- "type": 3,
- "data": {
- "source": 2,
- "type": 1,
- "id": 9,
- "x": 41.810001373291016,
- "y": 18.479999542236328
- },
- "timestamp": [timestamp]
- },
- {
- "type": 3,
- "data": {
- "source": 2,
- "type": 5,
- "id": 9
- },
- "timestamp": [timestamp]
- },
- {
- "type": 3,
- "data": {
- "source": 2,
- "type": 0,
- "id": 9,
- "x": 41.810001373291016,
- "y": 18.479999542236328
- },
- "timestamp": [timestamp]
- },
- {
- "type": 3,
- "data": {
- "source": 2,
- "type": 2,
- "id": 9,
- "x": 41,
- "y": 18,
- "pointerType": 0
- },
- "timestamp": [timestamp]
- }
-]
\ No newline at end of file
diff --git a/dev-packages/browser-integration-tests/suites/replay/multiple-pages/test.ts-snapshots/seg-3-snap-incremental-chromium b/dev-packages/browser-integration-tests/suites/replay/multiple-pages/test.ts-snapshots/seg-3-snap-incremental-chromium
index 02a3e3f893d6..4e76cedf3b0c 100644
--- a/dev-packages/browser-integration-tests/suites/replay/multiple-pages/test.ts-snapshots/seg-3-snap-incremental-chromium
+++ b/dev-packages/browser-integration-tests/suites/replay/multiple-pages/test.ts-snapshots/seg-3-snap-incremental-chromium
@@ -6,7 +6,7 @@
"type": 1,
"id": 9,
"x": 41.810001373291016,
- "y": 18.479999542236328
+ "y": 18.5
},
"timestamp": [timestamp]
},
@@ -26,7 +26,7 @@
"type": 0,
"id": 9,
"x": 41.810001373291016,
- "y": 18.479999542236328
+ "y": 18.5
},
"timestamp": [timestamp]
},
diff --git a/dev-packages/browser-integration-tests/suites/replay/multiple-pages/test.ts-snapshots/seg-4-snap-full b/dev-packages/browser-integration-tests/suites/replay/multiple-pages/test.ts-snapshots/seg-4-snap-full
deleted file mode 100644
index 1c3d1f22aeba..000000000000
--- a/dev-packages/browser-integration-tests/suites/replay/multiple-pages/test.ts-snapshots/seg-4-snap-full
+++ /dev/null
@@ -1,156 +0,0 @@
-[
- {
- "type": 2,
- "data": {
- "node": {
- "type": 0,
- "childNodes": [
- {
- "type": 1,
- "name": "html",
- "publicId": "",
- "systemId": "",
- "id": 2
- },
- {
- "type": 2,
- "tagName": "html",
- "attributes": {},
- "childNodes": [
- {
- "type": 2,
- "tagName": "head",
- "attributes": {},
- "childNodes": [
- {
- "type": 2,
- "tagName": "meta",
- "attributes": {
- "charset": "utf-8"
- },
- "childNodes": [],
- "id": 5
- }
- ],
- "id": 4
- },
- {
- "type": 3,
- "textContent": "\n ",
- "id": 6
- },
- {
- "type": 2,
- "tagName": "body",
- "attributes": {},
- "childNodes": [
- {
- "type": 3,
- "textContent": "\n ",
- "id": 8
- },
- {
- "type": 2,
- "tagName": "h1",
- "attributes": {},
- "childNodes": [
- {
- "type": 3,
- "textContent": "********* ****",
- "id": 10
- }
- ],
- "id": 9
- },
- {
- "type": 3,
- "textContent": "\n ",
- "id": 11
- },
- {
- "type": 2,
- "tagName": "button",
- "attributes": {
- "id": "go-background"
- },
- "childNodes": [
- {
- "type": 3,
- "textContent": "*** ***",
- "id": 13
- }
- ],
- "id": 12
- },
- {
- "type": 3,
- "textContent": "\n ",
- "id": 14
- },
- {
- "type": 2,
- "tagName": "button",
- "attributes": {
- "id": "spa-navigation"
- },
- "childNodes": [
- {
- "type": 3,
- "textContent": "***** * *** **********",
- "id": 16
- }
- ],
- "id": 15
- },
- {
- "type": 3,
- "textContent": "\n ",
- "id": 17
- },
- {
- "type": 3,
- "textContent": "\n ",
- "id": 18
- },
- {
- "type": 2,
- "tagName": "a",
- "attributes": {
- "href": "http://sentry-test.io/index.html"
- },
- "childNodes": [
- {
- "type": 3,
- "textContent": "** **** ** ***** ****",
- "id": 20
- }
- ],
- "id": 19
- },
- {
- "type": 3,
- "textContent": "\n ",
- "id": 21
- },
- {
- "type": 3,
- "textContent": "\n\n",
- "id": 22
- }
- ],
- "id": 7
- }
- ],
- "id": 3
- }
- ],
- "id": 1
- },
- "initialOffset": {
- "left": 0,
- "top": 0
- }
- },
- "timestamp": [timestamp]
- }
-]
diff --git a/dev-packages/browser-integration-tests/suites/replay/multiple-pages/test.ts-snapshots/seg-5-snap-incremental b/dev-packages/browser-integration-tests/suites/replay/multiple-pages/test.ts-snapshots/seg-5-snap-incremental
deleted file mode 100644
index 6dd84be3e2dc..000000000000
--- a/dev-packages/browser-integration-tests/suites/replay/multiple-pages/test.ts-snapshots/seg-5-snap-incremental
+++ /dev/null
@@ -1,45 +0,0 @@
-[
- {
- "type": 3,
- "data": {
- "source": 2,
- "type": 1,
- "id": 12,
- "x": 41.810001373291016,
- "y": 90.37000274658203
- },
- "timestamp": [timestamp]
- },
- {
- "type": 3,
- "data": {
- "source": 2,
- "type": 5,
- "id": 12
- },
- "timestamp": [timestamp]
- },
- {
- "type": 3,
- "data": {
- "source": 2,
- "type": 0,
- "id": 12,
- "x": 41.810001373291016,
- "y": 90.37000274658203
- },
- "timestamp": [timestamp]
- },
- {
- "type": 3,
- "data": {
- "source": 2,
- "type": 2,
- "id": 12,
- "x": 41,
- "y": 90,
- "pointerType": 0
- },
- "timestamp": [timestamp]
- }
-]
\ No newline at end of file
diff --git a/dev-packages/browser-integration-tests/suites/replay/multiple-pages/test.ts-snapshots/seg-6-snap-incremental b/dev-packages/browser-integration-tests/suites/replay/multiple-pages/test.ts-snapshots/seg-6-snap-incremental
deleted file mode 100644
index 575f1210087b..000000000000
--- a/dev-packages/browser-integration-tests/suites/replay/multiple-pages/test.ts-snapshots/seg-6-snap-incremental
+++ /dev/null
@@ -1,54 +0,0 @@
-[
- {
- "type": 3,
- "data": {
- "source": 2,
- "type": 1,
- "id": 15,
- "x": 157.13999938964844,
- "y": 90.37000274658203
- },
- "timestamp": [timestamp]
- },
- {
- "type": 3,
- "data": {
- "source": 2,
- "type": 6,
- "id": 12
- },
- "timestamp": [timestamp]
- },
- {
- "type": 3,
- "data": {
- "source": 2,
- "type": 5,
- "id": 15
- },
- "timestamp": [timestamp]
- },
- {
- "type": 3,
- "data": {
- "source": 2,
- "type": 0,
- "id": 15,
- "x": 157.13999938964844,
- "y": 90.37000274658203
- },
- "timestamp": [timestamp]
- },
- {
- "type": 3,
- "data": {
- "source": 2,
- "type": 2,
- "id": 15,
- "x": 157,
- "y": 90,
- "pointerType": 0
- },
- "timestamp": [timestamp]
- }
-]
\ No newline at end of file
diff --git a/dev-packages/browser-integration-tests/suites/replay/multiple-pages/test.ts-snapshots/seg-7-snap-incremental b/dev-packages/browser-integration-tests/suites/replay/multiple-pages/test.ts-snapshots/seg-7-snap-incremental
deleted file mode 100644
index f952a6e3bfaa..000000000000
--- a/dev-packages/browser-integration-tests/suites/replay/multiple-pages/test.ts-snapshots/seg-7-snap-incremental
+++ /dev/null
@@ -1,54 +0,0 @@
-[
- {
- "type": 3,
- "data": {
- "source": 2,
- "type": 1,
- "id": 12,
- "x": 41.810001373291016,
- "y": 90.37000274658203
- },
- "timestamp": [timestamp]
- },
- {
- "type": 3,
- "data": {
- "source": 2,
- "type": 6,
- "id": 15
- },
- "timestamp": [timestamp]
- },
- {
- "type": 3,
- "data": {
- "source": 2,
- "type": 5,
- "id": 12
- },
- "timestamp": [timestamp]
- },
- {
- "type": 3,
- "data": {
- "source": 2,
- "type": 0,
- "id": 12,
- "x": 41.810001373291016,
- "y": 90.37000274658203
- },
- "timestamp": [timestamp]
- },
- {
- "type": 3,
- "data": {
- "source": 2,
- "type": 2,
- "id": 12,
- "x": 41,
- "y": 90,
- "pointerType": 0
- },
- "timestamp": [timestamp]
- }
-]
\ No newline at end of file
diff --git a/dev-packages/browser-integration-tests/suites/replay/multiple-pages/test.ts-snapshots/seg-8-snap-full b/dev-packages/browser-integration-tests/suites/replay/multiple-pages/test.ts-snapshots/seg-8-snap-full
deleted file mode 100644
index 0d77b67cb862..000000000000
--- a/dev-packages/browser-integration-tests/suites/replay/multiple-pages/test.ts-snapshots/seg-8-snap-full
+++ /dev/null
@@ -1,113 +0,0 @@
-[
- {
- "type": 2,
- "data": {
- "node": {
- "type": 0,
- "childNodes": [
- {
- "type": 1,
- "name": "html",
- "publicId": "",
- "systemId": "",
- "id": 2
- },
- {
- "type": 2,
- "tagName": "html",
- "attributes": {},
- "childNodes": [
- {
- "type": 2,
- "tagName": "head",
- "attributes": {},
- "childNodes": [
- {
- "type": 2,
- "tagName": "meta",
- "attributes": {
- "charset": "utf-8"
- },
- "childNodes": [],
- "id": 5
- }
- ],
- "id": 4
- },
- {
- "type": 3,
- "textContent": "\n ",
- "id": 6
- },
- {
- "type": 2,
- "tagName": "body",
- "attributes": {},
- "childNodes": [
- {
- "type": 3,
- "textContent": "\n ",
- "id": 8
- },
- {
- "type": 2,
- "tagName": "button",
- "attributes": {
- "id": "go-background"
- },
- "childNodes": [
- {
- "type": 3,
- "textContent": "*** ***",
- "id": 10
- }
- ],
- "id": 9
- },
- {
- "type": 3,
- "textContent": "\n ",
- "id": 11
- },
- {
- "type": 2,
- "tagName": "a",
- "attributes": {
- "href": "http://sentry-test.io/page-0.html"
- },
- "childNodes": [
- {
- "type": 3,
- "textContent": "** ** *** ****",
- "id": 13
- }
- ],
- "id": 12
- },
- {
- "type": 3,
- "textContent": "\n ",
- "id": 14
- },
- {
- "type": 3,
- "textContent": "\n\n",
- "id": 15
- }
- ],
- "id": 7
- }
- ],
- "id": 3
- }
- ],
- "id": 1
- },
- "initialOffset": {
- "left": 0,
- "top": 0
- }
- },
- "timestamp": [timestamp]
- }
-]
diff --git a/dev-packages/browser-integration-tests/suites/replay/multiple-pages/test.ts-snapshots/seg-9-snap-incremental b/dev-packages/browser-integration-tests/suites/replay/multiple-pages/test.ts-snapshots/seg-9-snap-incremental
deleted file mode 100644
index 02a3e3f893d6..000000000000
--- a/dev-packages/browser-integration-tests/suites/replay/multiple-pages/test.ts-snapshots/seg-9-snap-incremental
+++ /dev/null
@@ -1,45 +0,0 @@
-[
- {
- "type": 3,
- "data": {
- "source": 2,
- "type": 1,
- "id": 9,
- "x": 41.810001373291016,
- "y": 18.479999542236328
- },
- "timestamp": [timestamp]
- },
- {
- "type": 3,
- "data": {
- "source": 2,
- "type": 5,
- "id": 9
- },
- "timestamp": [timestamp]
- },
- {
- "type": 3,
- "data": {
- "source": 2,
- "type": 0,
- "id": 9,
- "x": 41.810001373291016,
- "y": 18.479999542236328
- },
- "timestamp": [timestamp]
- },
- {
- "type": 3,
- "data": {
- "source": 2,
- "type": 2,
- "id": 9,
- "x": 41,
- "y": 18,
- "pointerType": 0
- },
- "timestamp": [timestamp]
- }
-]
\ No newline at end of file
diff --git a/dev-packages/browser-integration-tests/suites/replay/multiple-pages/test.ts-snapshots/seg-9-snap-incremental-chromium b/dev-packages/browser-integration-tests/suites/replay/multiple-pages/test.ts-snapshots/seg-9-snap-incremental-chromium
index 02a3e3f893d6..4e76cedf3b0c 100644
--- a/dev-packages/browser-integration-tests/suites/replay/multiple-pages/test.ts-snapshots/seg-9-snap-incremental-chromium
+++ b/dev-packages/browser-integration-tests/suites/replay/multiple-pages/test.ts-snapshots/seg-9-snap-incremental-chromium
@@ -6,7 +6,7 @@
"type": 1,
"id": 9,
"x": 41.810001373291016,
- "y": 18.479999542236328
+ "y": 18.5
},
"timestamp": [timestamp]
},
@@ -26,7 +26,7 @@
"type": 0,
"id": 9,
"x": 41.810001373291016,
- "y": 18.479999542236328
+ "y": 18.5
},
"timestamp": [timestamp]
},
diff --git a/dev-packages/browser-integration-tests/suites/replay/sessionExpiry/test.ts b/dev-packages/browser-integration-tests/suites/replay/sessionExpiry/test.ts
index 79c7758ec099..6bb199c42146 100644
--- a/dev-packages/browser-integration-tests/suites/replay/sessionExpiry/test.ts
+++ b/dev-packages/browser-integration-tests/suites/replay/sessionExpiry/test.ts
@@ -15,7 +15,7 @@ import {
const SESSION_TIMEOUT = 2000;
sentryTest('handles an expired session', async ({ browserName, forceFlushReplay, getLocalTestUrl, page }) => {
- if (shouldSkipReplayTest() || browserName === 'webkit') {
+ if (shouldSkipReplayTest() || browserName !== 'chromium') {
sentryTest.skip();
}
diff --git a/dev-packages/browser-integration-tests/suites/replay/sessionExpiry/test.ts-snapshots/snapshot-0-webkit.json b/dev-packages/browser-integration-tests/suites/replay/sessionExpiry/test.ts-snapshots/snapshot-0-webkit.json
deleted file mode 100644
index d510b410a343..000000000000
--- a/dev-packages/browser-integration-tests/suites/replay/sessionExpiry/test.ts-snapshots/snapshot-0-webkit.json
+++ /dev/null
@@ -1,113 +0,0 @@
-{
- "type": 2,
- "data": {
- "node": {
- "type": 0,
- "childNodes": [
- {
- "type": 1,
- "name": "html",
- "publicId": "",
- "systemId": "",
- "id": 2
- },
- {
- "type": 2,
- "tagName": "html",
- "attributes": {},
- "childNodes": [
- {
- "type": 2,
- "tagName": "head",
- "attributes": {},
- "childNodes": [
- {
- "type": 2,
- "tagName": "meta",
- "attributes": {
- "charset": "utf-8"
- },
- "childNodes": [],
- "id": 5
- }
- ],
- "id": 4
- },
- {
- "type": 3,
- "textContent": "\n ",
- "id": 6
- },
- {
- "type": 2,
- "tagName": "body",
- "attributes": {},
- "childNodes": [
- {
- "type": 3,
- "textContent": "\n ",
- "id": 8
- },
- {
- "type": 2,
- "tagName": "button",
- "attributes": {
- "onclick": "console.log('Test log 1')",
- "id": "button1"
- },
- "childNodes": [
- {
- "type": 3,
- "textContent": "***** **",
- "id": 10
- }
- ],
- "id": 9
- },
- {
- "type": 3,
- "textContent": "\n ",
- "id": 11
- },
- {
- "type": 2,
- "tagName": "button",
- "attributes": {
- "onclick": "console.log('Test log 2')",
- "id": "button2"
- },
- "childNodes": [
- {
- "type": 3,
- "textContent": "***** **",
- "id": 13
- }
- ],
- "id": 12
- },
- {
- "type": 3,
- "textContent": "\n ",
- "id": 14
- },
- {
- "type": 3,
- "textContent": "\n\n",
- "id": 15
- }
- ],
- "id": 7
- }
- ],
- "id": 3
- }
- ],
- "id": 1
- },
- "initialOffset": {
- "left": 0,
- "top": 0
- }
- },
- "timestamp": [timestamp]
-}
\ No newline at end of file
diff --git a/dev-packages/browser-integration-tests/suites/replay/sessionExpiry/test.ts-snapshots/snapshot-2-webkit.json b/dev-packages/browser-integration-tests/suites/replay/sessionExpiry/test.ts-snapshots/snapshot-2-webkit.json
deleted file mode 100644
index 13e5b1b70103..000000000000
--- a/dev-packages/browser-integration-tests/suites/replay/sessionExpiry/test.ts-snapshots/snapshot-2-webkit.json
+++ /dev/null
@@ -1,127 +0,0 @@
-{
- "type": 2,
- "data": {
- "node": {
- "type": 0,
- "childNodes": [
- {
- "type": 1,
- "name": "html",
- "publicId": "",
- "systemId": "",
- "rootId": 16,
- "id": 17
- },
- {
- "type": 2,
- "tagName": "html",
- "attributes": {},
- "childNodes": [
- {
- "type": 2,
- "tagName": "head",
- "attributes": {},
- "childNodes": [
- {
- "type": 2,
- "tagName": "meta",
- "attributes": {
- "charset": "utf-8"
- },
- "childNodes": [],
- "rootId": 16,
- "id": 20
- }
- ],
- "rootId": 16,
- "id": 19
- },
- {
- "type": 3,
- "textContent": "\n ",
- "rootId": 16,
- "id": 21
- },
- {
- "type": 2,
- "tagName": "body",
- "attributes": {},
- "childNodes": [
- {
- "type": 3,
- "textContent": "\n ",
- "rootId": 16,
- "id": 23
- },
- {
- "type": 2,
- "tagName": "button",
- "attributes": {
- "onclick": "console.log('Test log 1')",
- "id": "button1"
- },
- "childNodes": [
- {
- "type": 3,
- "textContent": "***** **",
- "rootId": 16,
- "id": 25
- }
- ],
- "rootId": 16,
- "id": 24
- },
- {
- "type": 3,
- "textContent": "\n ",
- "rootId": 16,
- "id": 26
- },
- {
- "type": 2,
- "tagName": "button",
- "attributes": {
- "onclick": "console.log('Test log 2')",
- "id": "button2"
- },
- "childNodes": [
- {
- "type": 3,
- "textContent": "***** **",
- "rootId": 16,
- "id": 28
- }
- ],
- "rootId": 16,
- "id": 27
- },
- {
- "type": 3,
- "textContent": "\n ",
- "rootId": 16,
- "id": 29
- },
- {
- "type": 3,
- "textContent": "\n\n",
- "rootId": 16,
- "id": 30
- }
- ],
- "rootId": 16,
- "id": 22
- }
- ],
- "rootId": 16,
- "id": 18
- }
- ],
- "id": 16
- },
- "initialOffset": {
- "left": 0,
- "top": 0
- }
- },
- "timestamp": [timestamp]
-}
\ No newline at end of file
diff --git a/dev-packages/browser-integration-tests/suites/stacktraces/init.js b/dev-packages/browser-integration-tests/suites/stacktraces/init.js
index d8c94f36fdd0..ce283e32d303 100644
--- a/dev-packages/browser-integration-tests/suites/stacktraces/init.js
+++ b/dev-packages/browser-integration-tests/suites/stacktraces/init.js
@@ -4,4 +4,10 @@ window.Sentry = Sentry;
Sentry.init({
dsn: 'https://public@dsn.ingest.sentry.io/1337',
+ transportOptions: {
+ fetchOptions: {
+ // See: https://github.com/microsoft/playwright/issues/34497
+ keepalive: false,
+ },
+ },
});
diff --git a/dev-packages/browser-integration-tests/suites/stacktraces/template.html b/dev-packages/browser-integration-tests/suites/stacktraces/template.html
index d91677daaab5..39082f45e532 100644
--- a/dev-packages/browser-integration-tests/suites/stacktraces/template.html
+++ b/dev-packages/browser-integration-tests/suites/stacktraces/template.html
@@ -3,9 +3,7 @@
-
-