Skip to content

Commit 848335f

Browse files
authored
Merge pull request #9551 from getsentry/prepare-release/7.80.1
meta(changelog): Update changelog for 7.80.1
2 parents e4ff63b + 4d9e57f commit 848335f

File tree

48 files changed

+666
-250
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+666
-250
lines changed

CHANGELOG.md

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@
44

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

7+
## 7.80.1
8+
9+
- fix(astro): Adjust Vite plugin config to upload server source maps (#9541)
10+
- fix(nextjs): Add tracing extensions in all serverside wrappers (#9537)
11+
- fix(nextjs): Fix serverside transaction names on Windows (#9526)
12+
- fix(node): Fix tRPC middleware typing (#9540)
13+
- fix(replay): Add additional safeguards for capturing network bodies (#9506)
14+
- fix(tracing): Update prisma span to be `db.prisma` (#9512)
15+
716
## 7.80.0
817

918
- feat(astro): Add distributed tracing via `<meta>` tags (#9483)
@@ -32,7 +41,7 @@ This was possible by extensive use of tree shaking and a host of small changes t
3241

3342
By using [tree shaking](https://docs.sentry.io/platforms/javascript/configuration/tree-shaking/) it is possible to shave up to 10 additional KB off the bundle.
3443

35-
#### Other Changes
44+
### Other Changes
3645

3746
- feat(astro): Add Sentry middleware (#9445)
3847
- feat(feedback): Add "outline focus" and "foreground hover" vars (#9462)
@@ -52,13 +61,18 @@ By using [tree shaking](https://docs.sentry.io/platforms/javascript/configuratio
5261

5362
## 7.77.0
5463

64+
### Security Fixes
65+
66+
- fix(nextjs): Match only numbers as orgid in tunnelRoute (#9416) (CVE-2023-46729)
67+
- fix(nextjs): Strictly validate tunnel target parameters (#9415) (CVE-2023-46729)
68+
69+
### Other Changes
70+
5571
- feat: Move LinkedErrors integration to @sentry/core (#9404)
5672
- feat(remix): Update sentry-cli version to ^2.21.2 (#9401)
5773
- feat(replay): Allow to treeshake & configure compression worker URL (#9409)
5874
- fix(angular-ivy): Adjust package entry points to support Angular 17 with SSR config (#9412)
5975
- fix(feedback): Fixing feedback import (#9403)
60-
- fix(nextjs): Match only numbers as orgid in tunnelRoute (#9416)
61-
- fix(nextjs): Strictly validate tunnel target parameters (#9415)
6276
- fix(utils): Avoid keeping a reference of last used event (#9387)
6377

6478
## 7.76.0

packages/astro/src/integration/index.ts

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* eslint-disable no-console */
22
import { sentryVitePlugin } from '@sentry/vite-plugin';
3-
import type { AstroIntegration } from 'astro';
3+
import type { AstroConfig, AstroIntegration } from 'astro';
44
import * as fs from 'fs';
55
import * as path from 'path';
66

@@ -13,7 +13,8 @@ export const sentryAstro = (options: SentryOptions = {}): AstroIntegration => {
1313
return {
1414
name: PKG_NAME,
1515
hooks: {
16-
'astro:config:setup': async ({ updateConfig, injectScript }) => {
16+
// eslint-disable-next-line complexity
17+
'astro:config:setup': async ({ updateConfig, injectScript, config }) => {
1718
// The third param here enables loading of all env vars, regardless of prefix
1819
// see: https://main.vitejs.dev/config/#using-environment-variables-in-config
1920

@@ -40,6 +41,10 @@ export const sentryAstro = (options: SentryOptions = {}): AstroIntegration => {
4041
project: uploadOptions.project ?? env.SENTRY_PROJECT,
4142
authToken: uploadOptions.authToken ?? env.SENTRY_AUTH_TOKEN,
4243
telemetry: uploadOptions.telemetry ?? true,
44+
sourcemaps: {
45+
assets: [getSourcemapsAssetsGlob(config)],
46+
},
47+
debug: options.debug ?? false,
4348
}),
4449
],
4550
},
@@ -79,3 +84,17 @@ function findDefaultSdkInitFile(type: 'server' | 'client'): string | undefined {
7984
.map(ext => path.resolve(path.join(process.cwd(), `sentry.${type}.config.${ext}`)))
8085
.find(filename => fs.existsSync(filename));
8186
}
87+
88+
function getSourcemapsAssetsGlob(config: AstroConfig): string {
89+
// paths are stored as "file://" URLs
90+
const outDirPathname = config.outDir && path.resolve(config.outDir.pathname);
91+
const rootDirName = path.resolve((config.root && config.root.pathname) || process.cwd());
92+
93+
if (outDirPathname) {
94+
const relativePath = path.relative(rootDirName, outDirPathname);
95+
return `${relativePath}/**/*`;
96+
}
97+
98+
// fallback to default output dir
99+
return 'dist/**/*';
100+
}

packages/astro/test/integration/index.test.ts

Lines changed: 35 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@ process.env = {
1414
SENTRY_AUTH_TOKEN: 'my-token',
1515
};
1616

17+
const updateConfig = vi.fn();
18+
const injectScript = vi.fn();
19+
const config = {
20+
root: new URL('file://path/to/project'),
21+
outDir: new URL('file://path/to/project/out'),
22+
};
23+
1724
describe('sentryAstro integration', () => {
1825
afterEach(() => {
1926
vi.clearAllMocks();
@@ -28,12 +35,10 @@ describe('sentryAstro integration', () => {
2835
const integration = sentryAstro({
2936
sourceMapsUploadOptions: { enabled: true, org: 'my-org', project: 'my-project', telemetry: false },
3037
});
31-
const updateConfig = vi.fn();
32-
const injectScript = vi.fn();
3338

3439
expect(integration.hooks['astro:config:setup']).toBeDefined();
3540
// @ts-expect-error - the hook exists and we only need to pass what we actually use
36-
await integration.hooks['astro:config:setup']({ updateConfig, injectScript });
41+
await integration.hooks['astro:config:setup']({ updateConfig, injectScript, config });
3742

3843
expect(updateConfig).toHaveBeenCalledTimes(1);
3944
expect(updateConfig).toHaveBeenCalledWith({
@@ -51,32 +56,52 @@ describe('sentryAstro integration', () => {
5156
org: 'my-org',
5257
project: 'my-project',
5358
telemetry: false,
59+
debug: false,
60+
sourcemaps: {
61+
assets: ['out/**/*'],
62+
},
63+
});
64+
});
65+
66+
it('falls back to default output dir, if out and root dir are not available', async () => {
67+
const integration = sentryAstro({
68+
sourceMapsUploadOptions: { enabled: true, org: 'my-org', project: 'my-project', telemetry: false },
69+
});
70+
// @ts-expect-error - the hook exists and we only need to pass what we actually use
71+
await integration.hooks['astro:config:setup']({ updateConfig, injectScript, config: {} });
72+
73+
expect(sentryVitePluginSpy).toHaveBeenCalledTimes(1);
74+
expect(sentryVitePluginSpy).toHaveBeenCalledWith({
75+
authToken: 'my-token',
76+
org: 'my-org',
77+
project: 'my-project',
78+
telemetry: false,
79+
debug: false,
80+
sourcemaps: {
81+
assets: ['dist/**/*'],
82+
},
5483
});
5584
});
5685

5786
it("doesn't enable source maps if `sourceMapsUploadOptions.enabled` is `false`", async () => {
5887
const integration = sentryAstro({
5988
sourceMapsUploadOptions: { enabled: false },
6089
});
61-
const updateConfig = vi.fn();
62-
const injectScript = vi.fn();
6390

6491
expect(integration.hooks['astro:config:setup']).toBeDefined();
6592
// @ts-expect-error - the hook exists and we only need to pass what we actually use
66-
await integration.hooks['astro:config:setup']({ updateConfig, injectScript });
93+
await integration.hooks['astro:config:setup']({ updateConfig, injectScript, config });
6794

6895
expect(updateConfig).toHaveBeenCalledTimes(0);
6996
expect(sentryVitePluginSpy).toHaveBeenCalledTimes(0);
7097
});
7198

7299
it('injects client and server init scripts', async () => {
73100
const integration = sentryAstro({});
74-
const updateConfig = vi.fn();
75-
const injectScript = vi.fn();
76101

77102
expect(integration.hooks['astro:config:setup']).toBeDefined();
78103
// @ts-expect-error - the hook exists and we only need to pass what we actually use
79-
await integration.hooks['astro:config:setup']({ updateConfig, injectScript });
104+
await integration.hooks['astro:config:setup']({ updateConfig, injectScript, config });
80105

81106
expect(injectScript).toHaveBeenCalledTimes(2);
82107
expect(injectScript).toHaveBeenCalledWith('page', expect.stringContaining('Sentry.init'));
@@ -89,12 +114,9 @@ describe('sentryAstro integration', () => {
89114
serverInitPath: 'my-server-init-path.js',
90115
});
91116

92-
const updateConfig = vi.fn();
93-
const injectScript = vi.fn();
94-
95117
expect(integration.hooks['astro:config:setup']).toBeDefined();
96118
// @ts-expect-error - the hook exists and we only need to pass what we actually use
97-
await integration.hooks['astro:config:setup']({ updateConfig, injectScript });
119+
await integration.hooks['astro:config:setup']({ updateConfig, injectScript, config });
98120

99121
expect(injectScript).toHaveBeenCalledTimes(2);
100122
expect(injectScript).toHaveBeenCalledWith('page', expect.stringContaining('my-client-init-path.js'));

packages/browser-integration-tests/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
"dependencies": {
5050
"@babel/preset-typescript": "^7.16.7",
5151
"@playwright/test": "^1.31.1",
52-
"axios": "1.3.4",
52+
"axios": "1.6.0",
5353
"babel-loader": "^8.2.2",
5454
"html-webpack-plugin": "^5.5.0",
5555
"pako": "^2.1.0",

packages/browser-integration-tests/suites/integrations/Breadcrumbs/dom/click/test.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,7 @@ sentryTest('captures Breadcrumb for clicks & debounces them for a second', async
3333
await page.waitForTimeout(1000);
3434
await page.click('#button2');
3535

36-
await page.evaluate('Sentry.captureException("test exception")');
37-
38-
const eventData = await promise;
36+
const [eventData] = await Promise.all([promise, page.evaluate('Sentry.captureException("test exception")')]);
3937

4038
expect(eventData.exception?.values).toHaveLength(1);
4139

packages/browser-integration-tests/suites/replay/extendNetworkBreadcrumbs/xhr/captureRequestHeaders/test.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ sentryTest('captures request headers', async ({ getLocalTestPath, page, browserN
5454
/* eslint-enable */
5555
});
5656

57-
const request = await requestPromise;
57+
const [request, replayReq1] = await Promise.all([requestPromise, replayRequestPromise1]);
5858
const eventData = envelopeRequestParser(request);
5959

6060
expect(eventData.exception?.values).toHaveLength(1);
@@ -71,7 +71,6 @@ sentryTest('captures request headers', async ({ getLocalTestPath, page, browserN
7171
},
7272
});
7373

74-
const replayReq1 = await replayRequestPromise1;
7574
const { performanceSpans: performanceSpans1 } = getCustomRecordingEvents(replayReq1);
7675
expect(performanceSpans1.filter(span => span.op === 'resource.xhr')).toEqual([
7776
{
@@ -142,7 +141,8 @@ sentryTest(
142141
/* eslint-enable */
143142
});
144143

145-
const request = await requestPromise;
144+
const [request, replayReq1] = await Promise.all([requestPromise, replayRequestPromise1]);
145+
146146
const eventData = envelopeRequestParser(request);
147147

148148
expect(eventData.exception?.values).toHaveLength(1);
@@ -159,7 +159,6 @@ sentryTest(
159159
},
160160
});
161161

162-
const replayReq1 = await replayRequestPromise1;
163162
const { performanceSpans: performanceSpans1 } = getCustomRecordingEvents(replayReq1);
164163
expect(performanceSpans1.filter(span => span.op === 'resource.xhr')).toEqual([
165164
{

packages/browser-integration-tests/suites/replay/privacyInputMaskAll/test.ts

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -57,22 +57,24 @@ sentryTest(
5757
const url = await getLocalTestPath({ testDir: __dirname });
5858

5959
await page.goto(url);
60-
const fullSnapshot = getFullRecordingSnapshots(await reqPromise0);
60+
61+
const text = 'test';
62+
63+
const [req0] = await Promise.all([reqPromise0, page.locator('#input').fill(text)]);
64+
await forceFlushReplay();
65+
66+
const fullSnapshot = getFullRecordingSnapshots(req0);
6167
const stringifiedSnapshot = JSON.stringify(fullSnapshot);
6268
expect(stringifiedSnapshot.includes('Submit form')).toBe(false);
6369
expect(stringifiedSnapshot.includes('Unmasked button')).toBe(true);
6470

65-
const text = 'test';
66-
67-
await page.locator('#input').fill(text);
71+
const [req1] = await Promise.all([reqPromise1, page.locator('#input-unmasked').fill(text)]);
6872
await forceFlushReplay();
6973

70-
const snapshots = getIncrementalRecordingSnapshots(await reqPromise1).filter(isInputMutation);
74+
const snapshots = getIncrementalRecordingSnapshots(req1).filter(isInputMutation);
7175
const lastSnapshot = snapshots[snapshots.length - 1];
7276
expect(lastSnapshot.data.text).toBe('*'.repeat(text.length));
7377

74-
await page.locator('#input-unmasked').fill(text);
75-
await forceFlushReplay();
7678
const snapshots2 = getIncrementalRecordingSnapshots(await reqPromise2).filter(isInputMutation);
7779
const lastSnapshot2 = snapshots2[snapshots2.length - 1];
7880
expect(lastSnapshot2.data.text).toBe(text);
@@ -120,18 +122,18 @@ sentryTest(
120122

121123
await page.goto(url);
122124

123-
await reqPromise0;
124-
125125
const text = 'test';
126126

127-
await page.locator('#textarea').fill(text);
127+
await Promise.all([reqPromise0, page.locator('#textarea').fill(text)]);
128+
await forceFlushReplay();
129+
130+
const [req1] = await Promise.all([reqPromise1, page.locator('#textarea-unmasked').fill(text)]);
128131
await forceFlushReplay();
129-
const snapshots = getIncrementalRecordingSnapshots(await reqPromise1).filter(isInputMutation);
132+
133+
const snapshots = getIncrementalRecordingSnapshots(req1).filter(isInputMutation);
130134
const lastSnapshot = snapshots[snapshots.length - 1];
131135
expect(lastSnapshot.data.text).toBe('*'.repeat(text.length));
132136

133-
await page.locator('#textarea-unmasked').fill(text);
134-
await forceFlushReplay();
135137
const snapshots2 = getIncrementalRecordingSnapshots(await reqPromise2).filter(isInputMutation);
136138
const lastSnapshot2 = snapshots2[snapshots2.length - 1];
137139
expect(lastSnapshot2.data.text).toBe(text);

packages/e2e-tests/test-applications/react-create-hash-router/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
},
4848
"devDependencies": {
4949
"@playwright/test": "1.26.1",
50-
"axios": "1.1.2",
50+
"axios": "1.6.0",
5151
"serve": "14.0.1"
5252
},
5353
"volta": {

packages/e2e-tests/test-applications/react-router-6-use-routes/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
},
4949
"devDependencies": {
5050
"@playwright/test": "1.26.1",
51-
"axios": "1.1.2",
51+
"axios": "1.6.0",
5252
"serve": "14.0.1"
5353
},
5454
"volta": {

packages/e2e-tests/test-applications/standard-frontend-react-tracing-import/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
},
4848
"devDependencies": {
4949
"@playwright/test": "1.26.1",
50-
"axios": "1.1.2",
50+
"axios": "1.6.0",
5151
"serve": "14.0.1"
5252
},
5353
"volta": {

packages/e2e-tests/test-applications/standard-frontend-react/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
},
4949
"devDependencies": {
5050
"@playwright/test": "1.26.1",
51-
"axios": "1.1.2",
51+
"axios": "1.6.0",
5252
"serve": "14.0.1"
5353
},
5454
"volta": {

packages/feedback/src/sendFeedback.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,14 @@ interface SendFeedbackParams {
1010
name?: string;
1111
email?: string;
1212
url?: string;
13+
source?: string;
1314
}
1415

1516
/**
1617
* Public API to send a Feedback item to Sentry
1718
*/
1819
export function sendFeedback(
19-
{ name, email, message, url = getLocationHref() }: SendFeedbackParams,
20+
{ name, email, message, source = 'api', url = getLocationHref() }: SendFeedbackParams,
2021
{ includeReplay = true }: SendFeedbackOptions = {},
2122
): ReturnType<typeof sendFeedbackRequest> {
2223
const client = getCurrentHub().getClient<BrowserClient>();
@@ -37,6 +38,7 @@ export function sendFeedback(
3738
message,
3839
url,
3940
replay_id: replayId,
41+
source,
4042
},
4143
});
4244
}

packages/feedback/src/types/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export interface SendFeedbackData {
1212
email?: string;
1313
replay_id?: string;
1414
name?: string;
15+
source?: string;
1516
};
1617
}
1718

packages/feedback/src/util/handleFeedbackSubmit.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export async function handleFeedbackSubmit(
2929
dialog.hideError();
3030

3131
try {
32-
const resp = await sendFeedback(feedback, options);
32+
const resp = await sendFeedback({ ...feedback, source: 'widget' }, options);
3333

3434
// Success!
3535
return resp;

packages/feedback/src/util/sendFeedbackRequest.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { prepareFeedbackEvent } from './prepareFeedbackEvent';
88
* Send feedback using transport
99
*/
1010
export async function sendFeedbackRequest({
11-
feedback: { message, email, name, replay_id, url },
11+
feedback: { message, email, name, source, replay_id, url },
1212
}: SendFeedbackData): Promise<void | TransportMakeRequestResponse> {
1313
const hub = getCurrentHub();
1414
const client = hub.getClient();
@@ -28,6 +28,7 @@ export async function sendFeedbackRequest({
2828
message,
2929
replay_id,
3030
url,
31+
source,
3132
},
3233
},
3334
type: 'feedback',

0 commit comments

Comments
 (0)