Skip to content

Commit 1e1bebb

Browse files
authored
Merge pull request #15727 from getsentry/prepare-release/9.6.1
meta(changelog): Update changelog for 9.6.1
2 parents eabcdd0 + 3552196 commit 1e1bebb

File tree

31 files changed

+647
-688
lines changed

31 files changed

+647
-688
lines changed

.github/workflows/build.yml

+3
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,9 @@ jobs:
274274
uses: ./.github/actions/restore-cache
275275
with:
276276
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
277+
- name: Check for duplicate dependencies in lockfile
278+
# Run `yarn dedupe-deps:fix` locally to resolve any duplicates.
279+
run: yarn dedupe-deps:check
277280
- name: Lint source files
278281
run: yarn lint:lerna
279282
- name: Lint for ES compatibility

.github/workflows/canary.yml

+6
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,12 @@ jobs:
108108
- test-application: 'react-router-6'
109109
build-command: 'test:build-canary'
110110
label: 'react-router-6 (canary)'
111+
- test-application: 'nuxt-3'
112+
build-command: 'test:build-canary'
113+
label: 'nuxt-3 (canary)'
114+
- test-application: 'nuxt-4'
115+
build-command: 'test:build-canary'
116+
label: 'nuxt-4 (canary)'
111117

112118
steps:
113119
- name: Check out current commit

CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@
1010

1111
- "You miss 100 percent of the chances you don't take. — Wayne Gretzky" — Michael Scott
1212

13+
## 9.6.1
14+
15+
- feat(deps): bump @prisma/instrumentation from 6.4.1 to 6.5.0 ([#15714](https://github.com/getsentry/sentry-javascript/pull/15714))
16+
- feat(deps): bump @sentry/cli from 2.42.2 to 2.42.3 ([#15711](https://github.com/getsentry/sentry-javascript/pull/15711))
17+
- fix(nextjs): Re-patch router if it is overridden by Next.js ([#15721](https://github.com/getsentry/sentry-javascript/pull/15721))
18+
- fix(nuxt): Add Nitro Rollup plugin to inject Sentry server config ([#15710](https://github.com/getsentry/sentry-javascript/pull/15710))
19+
- chore(deps): Bump rollup to 4.35.0 ([#15651](https://github.com/getsentry/sentry-javascript/pull/15651))
20+
1321
## 9.6.0
1422

1523
### Important Changes

dev-packages/e2e-tests/test-applications/debug-id-sourcemaps/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"@sentry/node": "latest || *"
1414
},
1515
"devDependencies": {
16-
"rollup": "^4.24.2",
16+
"rollup": "^4.35.0",
1717
"vitest": "^0.34.6",
1818
"@sentry/rollup-plugin": "2.22.6"
1919
},

dev-packages/e2e-tests/test-applications/nuxt-3-dynamic-import/package.json

+5-3
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,10 @@
2121
"@playwright/test": "~1.50.0",
2222
"@sentry-internal/test-utils": "link:../../../test-utils"
2323
},
24-
"overrides": {
25-
"nitropack": "~2.9.7",
26-
"ofetch": "^1.4.0"
24+
"pnpm": {
25+
"overrides": {
26+
"nitropack": "~2.9.7",
27+
"ofetch": "^1.4.0"
28+
}
2729
}
2830
}

dev-packages/e2e-tests/test-applications/nuxt-3/package.json

+9
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"clean": "npx nuxi cleanup",
1313
"test": "playwright test",
1414
"test:build": "pnpm install && pnpm build",
15+
"test:build-canary": "pnpm add nuxt@npm:nuxt-nightly@3x && pnpm add nitropack@npm:nitropack-nightly@latest && pnpm install --force && pnpm build",
1516
"test:assert": "pnpm test"
1617
},
1718
"dependencies": {
@@ -21,5 +22,13 @@
2122
"devDependencies": {
2223
"@playwright/test": "~1.50.0",
2324
"@sentry-internal/test-utils": "link:../../../test-utils"
25+
},
26+
"sentryTest": {
27+
"optionalVariants": [
28+
{
29+
"build-command": "test:build-canary",
30+
"label": "nuxt-3 (canary)"
31+
}
32+
]
2433
}
2534
}

dev-packages/e2e-tests/test-applications/nuxt-4/package.json

+9
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"clean": "npx nuxi cleanup",
1313
"test": "playwright test",
1414
"test:build": "pnpm install && pnpm build",
15+
"test:build-canary": "pnpm add nuxt@npm:nuxt-nightly@latest && pnpm add nitropack@npm:nitropack-nightly@latest && pnpm install --force && pnpm build",
1516
"test:assert": "pnpm test"
1617
},
1718
"dependencies": {
@@ -25,5 +26,13 @@
2526
},
2627
"overrides": {
2728
"@vercel/nft": "0.27.4"
29+
},
30+
"sentryTest": {
31+
"optionalVariants": [
32+
{
33+
"build-command": "test:build-canary",
34+
"label": "nuxt-4 (canary)"
35+
}
36+
]
2837
}
2938
}

package.json

+5-2
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
"lint:lerna": "lerna run lint",
3030
"lint:prettier": "prettier \"**/*.{md,css,yml,yaml}\" \"packages/**/**.{ts,js,mjs,cjs,mts,cts,jsx,tsx,astro,vue}\" --check",
3131
"lint:es-compatibility": "es-check es2020 ./packages/*/build/{bundles,npm/cjs,cjs}/*.js && es-check es2020 ./packages/*/build/{npm/esm,esm}/*.js --module",
32+
"dedupe-deps:check": "yarn-deduplicate yarn.lock --list --fail",
33+
"dedupe-deps:fix": "yarn-deduplicate yarn.lock",
3234
"postpublish": "lerna run --stream --concurrency 1 postpublish",
3335
"test": "lerna run --ignore \"@sentry-internal/{browser-integration-tests,e2e-tests,integration-shims,node-integration-tests}\" test",
3436
"test:unit": "lerna run --ignore \"@sentry-internal/{browser-integration-tests,e2e-tests,integration-shims,node-integration-tests}\" test:unit",
@@ -126,7 +128,7 @@
126128
"npm-run-all2": "^6.2.0",
127129
"prettier": "^3.1.1",
128130
"rimraf": "^5.0.10",
129-
"rollup": "^4.24.2",
131+
"rollup": "^4.35.0",
130132
"rollup-plugin-cleanup": "^3.2.1",
131133
"rollup-plugin-license": "^3.3.1",
132134
"size-limit": "~11.1.6",
@@ -135,7 +137,8 @@
135137
"ts-node": "10.9.1",
136138
"typescript": "~5.0.0",
137139
"vitest": "^2.1.8",
138-
"yalc": "^1.0.0-pre.53"
140+
"yalc": "^1.0.0-pre.53",
141+
"yarn-deduplicate": "6.0.2"
139142
},
140143
"//_resolutions_comment": [
141144
"Because new versions of strip-ansi, string-width, and wrap-ansi are ESM only packages,",

packages/browser-utils/test/instrument/history.test.ts

+64-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
1-
import { describe, expect, it, vi } from 'vitest';
1+
import { describe, expect, it, vi, afterEach } from 'vitest';
22
import { WINDOW } from '../../src/types';
3-
import { afterEach } from 'node:test';
43

54
import { instrumentHistory } from './../../src/instrument/history';
5+
import * as instrumentHandlersModule from '@sentry/core';
66

77
describe('instrumentHistory', () => {
88
const originalHistory = WINDOW.history;
99
WINDOW.addEventListener = vi.fn();
10-
1110
afterEach(() => {
1211
// @ts-expect-error - this is fine for testing
1312
WINDOW.history = originalHistory;
@@ -55,4 +54,66 @@ describe('instrumentHistory', () => {
5554
pushState: expect.any(Function), // patched function
5655
});
5756
});
57+
58+
it('does not trigger handlers when the URLs are the same', () => {
59+
const triggerHandlerSpy = vi.spyOn(instrumentHandlersModule, 'triggerHandlers');
60+
const pushStateMock = vi.fn();
61+
62+
// @ts-expect-error - this is fine for testing
63+
WINDOW.history = {
64+
pushState: pushStateMock,
65+
replaceState: () => {},
66+
};
67+
68+
instrumentHistory();
69+
70+
// First call with URL1 to set lastHref
71+
WINDOW.history.pushState({}, '', 'https://example.com/page1');
72+
expect(pushStateMock).toHaveBeenCalledTimes(1);
73+
74+
// Reset mocks to check next call
75+
pushStateMock.mockClear();
76+
vi.mocked(triggerHandlerSpy).mockClear();
77+
78+
// Call with the same URL
79+
WINDOW.history.pushState({}, '', 'https://example.com/page1');
80+
81+
expect(pushStateMock).toHaveBeenCalledTimes(1);
82+
expect(triggerHandlerSpy).not.toHaveBeenCalled();
83+
});
84+
85+
it('triggers handlers when the URLs are different', () => {
86+
const triggerHandlerSpy = vi.spyOn(instrumentHandlersModule, 'triggerHandlers');
87+
// Setup a mock for history.pushState
88+
const pushStateMock = vi.fn();
89+
90+
// @ts-expect-error - this is fine for testing
91+
WINDOW.history = {
92+
pushState: pushStateMock,
93+
replaceState: () => {},
94+
};
95+
96+
// Run the instrumentation
97+
instrumentHistory();
98+
99+
// First call with URL1 to set lastHref
100+
WINDOW.history.pushState({}, '', 'https://example.com/page1');
101+
expect(pushStateMock).toHaveBeenCalledTimes(1);
102+
103+
// Reset mocks to check next call
104+
pushStateMock.mockClear();
105+
vi.mocked(triggerHandlerSpy).mockClear();
106+
107+
// Call with a different URL
108+
WINDOW.history.pushState({}, '', 'https://example.com/page2');
109+
110+
// Original function should be called
111+
expect(pushStateMock).toHaveBeenCalledTimes(1);
112+
113+
// triggerHandlers should be called with from and to data
114+
expect(triggerHandlerSpy).toHaveBeenCalledWith('history', {
115+
from: 'https://example.com/page1',
116+
to: 'https://example.com/page2',
117+
});
118+
});
58119
});

packages/core/src/types-hoist/envelope.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import type { LegacyCSPReport } from './csp';
55
import type { DsnComponents } from './dsn';
66
import type { Event } from './event';
77
import type { FeedbackEvent, UserFeedback } from './feedback';
8-
import type { Log } from './log';
8+
import type { SerializedOtelLog } from './log';
99
import type { Profile, ProfileChunk } from './profiling';
1010
import type { ReplayEvent, ReplayRecordingData } from './replay';
1111
import type { SdkInfo } from './sdkinfo';
@@ -87,7 +87,7 @@ type CheckInItemHeaders = { type: 'check_in' };
8787
type ProfileItemHeaders = { type: 'profile' };
8888
type ProfileChunkItemHeaders = { type: 'profile_chunk' };
8989
type SpanItemHeaders = { type: 'span' };
90-
type LogItemHeaders = { type: 'otel_log' };
90+
type OtelLogItemHeaders = { type: 'otel_log' };
9191
type RawSecurityHeaders = { type: 'raw_security'; sentry_release?: string; sentry_environment?: string };
9292

9393
export type EventItem = BaseEnvelopeItem<EventItemHeaders, Event>;
@@ -104,7 +104,7 @@ export type FeedbackItem = BaseEnvelopeItem<FeedbackItemHeaders, FeedbackEvent>;
104104
export type ProfileItem = BaseEnvelopeItem<ProfileItemHeaders, Profile>;
105105
export type ProfileChunkItem = BaseEnvelopeItem<ProfileChunkItemHeaders, ProfileChunk>;
106106
export type SpanItem = BaseEnvelopeItem<SpanItemHeaders, Partial<SpanJSON>>;
107-
export type LogItem = BaseEnvelopeItem<LogItemHeaders, Log>;
107+
export type OtelLogItem = BaseEnvelopeItem<OtelLogItemHeaders, SerializedOtelLog>;
108108
export type RawSecurityItem = BaseEnvelopeItem<RawSecurityHeaders, LegacyCSPReport>;
109109

110110
export type EventEnvelopeHeaders = { event_id: string; sent_at: string; trace?: Partial<DynamicSamplingContext> };
@@ -113,7 +113,7 @@ type CheckInEnvelopeHeaders = { trace?: DynamicSamplingContext };
113113
type ClientReportEnvelopeHeaders = BaseEnvelopeHeaders;
114114
type ReplayEnvelopeHeaders = BaseEnvelopeHeaders;
115115
type SpanEnvelopeHeaders = BaseEnvelopeHeaders & { trace?: DynamicSamplingContext };
116-
type LogEnvelopeHeaders = BaseEnvelopeHeaders & { trace?: DynamicSamplingContext };
116+
type OtelLogEnvelopeHeaders = BaseEnvelopeHeaders & { trace?: DynamicSamplingContext };
117117

118118
export type EventEnvelope = BaseEnvelope<
119119
EventEnvelopeHeaders,
@@ -126,7 +126,7 @@ export type CheckInEnvelope = BaseEnvelope<CheckInEnvelopeHeaders, CheckInItem>;
126126
export type SpanEnvelope = BaseEnvelope<SpanEnvelopeHeaders, SpanItem>;
127127
export type ProfileChunkEnvelope = BaseEnvelope<BaseEnvelopeHeaders, ProfileChunkItem>;
128128
export type RawSecurityEnvelope = BaseEnvelope<BaseEnvelopeHeaders, RawSecurityItem>;
129-
export type LogEnvelope = BaseEnvelope<LogEnvelopeHeaders, LogItem>;
129+
export type OtelLogEnvelope = BaseEnvelope<OtelLogEnvelopeHeaders, OtelLogItem>;
130130

131131
export type Envelope =
132132
| EventEnvelope
@@ -137,6 +137,6 @@ export type Envelope =
137137
| CheckInEnvelope
138138
| SpanEnvelope
139139
| RawSecurityEnvelope
140-
| LogEnvelope;
140+
| OtelLogEnvelope;
141141

142142
export type EnvelopeItem = Envelope[1][number];

packages/core/src/types-hoist/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ export type {
110110
TraceFlag,
111111
} from './span';
112112
export type { SpanStatus } from './spanStatus';
113-
export type { Log, LogAttribute, LogSeverityLevel, LogAttributeValueType } from './log';
113+
export type { SerializedOtelLog, LogAttribute, LogSeverityLevel, LogAttributeValueType } from './log';
114114
export type { TimedEvent } from './timedEvent';
115115
export type { StackFrame } from './stackframe';
116116
export type { Stacktrace, StackParser, StackLineParser, StackLineParserFn } from './stacktrace';

packages/core/src/types-hoist/log.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ export type LogAttributeValueType =
55
stringValue: string;
66
}
77
| {
8-
intValue: number;
8+
// integers must be represented as a string
9+
// because JSON cannot differentiate between integers and floats
10+
intValue: string;
911
}
1012
| {
1113
boolValue: boolean;
@@ -19,7 +21,7 @@ export type LogAttribute = {
1921
value: LogAttributeValueType;
2022
};
2123

22-
export interface Log {
24+
export interface SerializedOtelLog {
2325
/**
2426
* The severity level of the log.
2527
*

packages/nextjs/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@
8888
"@sentry/webpack-plugin": "3.2.2",
8989
"chalk": "3.0.0",
9090
"resolve": "1.22.8",
91-
"rollup": "4.34.9",
91+
"rollup": "4.35.0",
9292
"stacktrace-parser": "^0.1.10"
9393
},
9494
"devDependencies": {

0 commit comments

Comments
 (0)