Skip to content

Commit 193a78d

Browse files
authored
Merge pull request #19601 from getsentry/prepare-release/10.42.0
meta(changelog): Update changelog for 10.42.0
2 parents 08e27bd + 8738f9b commit 193a78d

File tree

26 files changed

+1434
-203
lines changed

26 files changed

+1434
-203
lines changed

.github/workflows/fix-security-vulnerability.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
issues: write
2525
id-token: write
2626
steps:
27-
- uses: actions/checkout@v4
27+
- uses: actions/checkout@v6
2828
with:
2929
ref: develop
3030

.github/workflows/triage-issue.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
echo "Processing issue #$ISSUE_NUM in CI mode"
4949
5050
- name: Checkout repository
51-
uses: actions/checkout@v4
51+
uses: actions/checkout@v6
5252
with:
5353
ref: develop
5454

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,24 @@
44

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

7+
## 10.42.0
8+
9+
- feat(consola): Enhance Consola integration to extract first-param object as searchable attributes ([#19534](https://github.com/getsentry/sentry-javascript/pull/19534))
10+
- fix(astro): Do not inject withSentry into Cloudflare Pages ([#19558](https://github.com/getsentry/sentry-javascript/pull/19558))
11+
- fix(core): Do not remove promiseBuffer entirely ([#19592](https://github.com/getsentry/sentry-javascript/pull/19592))
12+
- fix(deps): Bump fast-xml-parser to 4.5.4 for CVE-2026-25896 ([#19588](https://github.com/getsentry/sentry-javascript/pull/19588))
13+
- fix(react-router): Set correct transaction name when navigating with object argument ([#19590](https://github.com/getsentry/sentry-javascript/pull/19590))
14+
- ref(nuxt): Use `addVitePlugin` instead of deprecated `vite:extendConfig` ([#19464](https://github.com/getsentry/sentry-javascript/pull/19464))
15+
16+
<details>
17+
<summary> <strong>Internal Changes</strong> </summary>
18+
19+
- chore(deps-dev): bump @sveltejs/kit from 2.52.2 to 2.53.3 ([#19571](https://github.com/getsentry/sentry-javascript/pull/19571))
20+
- chore(deps): Bump @sveltejs/kit to 2.53.3 in sveltekit-2-svelte-5 E2E test ([#19594](https://github.com/getsentry/sentry-javascript/pull/19594))
21+
- ci(deps): bump actions/checkout from 4 to 6 ([#19570](https://github.com/getsentry/sentry-javascript/pull/19570))
22+
23+
</details>
24+
725
## 10.41.0
826

927
### Important Changes

dev-packages/e2e-tests/test-applications/react-router-7-framework/app/routes/performance/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ export default function PerformancePage() {
77
<nav>
88
<Link to="/performance/ssr">SSR Page</Link>
99
<Link to="/performance/with/sentry">With Param Page</Link>
10+
<Link to={{ pathname: '/performance/with/object-nav', search: '?foo=bar' }}>Object Navigate</Link>
11+
<Link to={{ search: '?query=test' }}>Search Only Navigate</Link>
1012
<Link to="/performance/server-loader">Server Loader</Link>
1113
</nav>
1214
</div>

dev-packages/e2e-tests/test-applications/react-router-7-framework/tests/performance/navigation.client.test.ts

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,56 @@ test.describe('client - navigation performance', () => {
5454
});
5555
});
5656

57+
test('should create navigation transaction when navigating with object `to` prop', async ({ page }) => {
58+
const txPromise = waitForTransaction(APP_NAME, async transactionEvent => {
59+
return transactionEvent.transaction === '/performance/with/:param';
60+
});
61+
62+
await page.goto(`/performance`); // pageload
63+
await page.waitForTimeout(1000); // give it a sec before navigation
64+
await page.getByRole('link', { name: 'Object Navigate' }).click(); // navigation with object to
65+
66+
const transaction = await txPromise;
67+
68+
expect(transaction).toMatchObject({
69+
contexts: {
70+
trace: {
71+
op: 'navigation',
72+
origin: 'auto.navigation.react_router',
73+
data: {
74+
'sentry.source': 'route',
75+
},
76+
},
77+
},
78+
transaction: '/performance/with/:param',
79+
type: 'transaction',
80+
transaction_info: { source: 'route' },
81+
});
82+
});
83+
84+
test('should create navigation transaction when navigating with search-only object `to` prop', async ({ page }) => {
85+
const txPromise = waitForTransaction(APP_NAME, async transactionEvent => {
86+
return transactionEvent.transaction === '/performance' && transactionEvent.contexts?.trace?.op === 'navigation';
87+
});
88+
89+
await page.goto(`/performance`); // pageload
90+
await page.waitForTimeout(1000); // give it a sec before navigation
91+
await page.getByRole('link', { name: 'Search Only Navigate' }).click(); // navigation with search-only object to
92+
93+
const transaction = await txPromise;
94+
95+
expect(transaction).toMatchObject({
96+
contexts: {
97+
trace: {
98+
op: 'navigation',
99+
origin: 'auto.navigation.react_router',
100+
},
101+
},
102+
transaction: '/performance',
103+
type: 'transaction',
104+
});
105+
});
106+
57107
test('should update navigation transaction for dynamic routes', async ({ page }) => {
58108
const txPromise = waitForTransaction(APP_NAME, async transactionEvent => {
59109
return transactionEvent.transaction === '/performance/with/:param';

dev-packages/e2e-tests/test-applications/sveltekit-2-svelte-5/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"@playwright/test": "~1.56.0",
2323
"@sentry-internal/test-utils": "link:../../../test-utils",
2424
"@sveltejs/adapter-auto": "^3.0.0",
25-
"@sveltejs/kit": "2.49.5",
25+
"@sveltejs/kit": "2.53.3",
2626
"@sveltejs/vite-plugin-svelte": "^3.0.0",
2727
"svelte": "^5.0.0-next.115",
2828
"svelte-check": "^3.6.0",
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import * as Sentry from '@sentry/node';
2+
import { loggingTransport } from '@sentry-internal/node-integration-tests';
3+
import { consola } from 'consola';
4+
5+
Sentry.init({
6+
dsn: 'https://public@dsn.ingest.sentry.io/1337',
7+
release: '1.0.0',
8+
environment: 'test',
9+
enableLogs: true,
10+
transport: loggingTransport,
11+
});
12+
13+
async function run(): Promise<void> {
14+
consola.level = 5;
15+
const sentryReporter = Sentry.createConsolaReporter();
16+
consola.addReporter(sentryReporter);
17+
18+
// Object-first: args = [object, string] — first object becomes attributes, second arg is part of formatted message
19+
consola.info({ userId: 100, action: 'login' }, 'User logged in');
20+
21+
// Object-first: args = [object] only — object keys become attributes, message is stringified object
22+
consola.info({ event: 'click', count: 2 });
23+
24+
await Sentry.flush();
25+
}
26+
27+
// eslint-disable-next-line @typescript-eslint/no-floating-promises
28+
void run();

dev-packages/node-integration-tests/suites/consola/test.ts

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -491,4 +491,55 @@ describe('consola integration', () => {
491491

492492
await runner.completed();
493493
});
494+
495+
test('should capture object-first consola logs (object as first arg)', async () => {
496+
const runner = createRunner(__dirname, 'subject-object-first.ts')
497+
.expect({
498+
log: {
499+
items: [
500+
{
501+
timestamp: expect.any(Number),
502+
level: 'info',
503+
body: '{"userId":100,"action":"login"} User logged in',
504+
severity_number: expect.any(Number),
505+
trace_id: expect.any(String),
506+
attributes: {
507+
'sentry.origin': { value: 'auto.log.consola', type: 'string' },
508+
'sentry.release': { value: '1.0.0', type: 'string' },
509+
'sentry.environment': { value: 'test', type: 'string' },
510+
'sentry.sdk.name': { value: 'sentry.javascript.node', type: 'string' },
511+
'sentry.sdk.version': { value: expect.any(String), type: 'string' },
512+
'server.address': { value: expect.any(String), type: 'string' },
513+
'consola.type': { value: 'info', type: 'string' },
514+
'consola.level': { value: 3, type: 'integer' },
515+
userId: { value: 100, type: 'integer' },
516+
action: { value: 'login', type: 'string' },
517+
},
518+
},
519+
{
520+
timestamp: expect.any(Number),
521+
level: 'info',
522+
body: '{"event":"click","count":2}',
523+
severity_number: expect.any(Number),
524+
trace_id: expect.any(String),
525+
attributes: {
526+
'sentry.origin': { value: 'auto.log.consola', type: 'string' },
527+
'sentry.release': { value: '1.0.0', type: 'string' },
528+
'sentry.environment': { value: 'test', type: 'string' },
529+
'sentry.sdk.name': { value: 'sentry.javascript.node', type: 'string' },
530+
'sentry.sdk.version': { value: expect.any(String), type: 'string' },
531+
'server.address': { value: expect.any(String), type: 'string' },
532+
'consola.type': { value: 'info', type: 'string' },
533+
'consola.level': { value: 3, type: 'integer' },
534+
event: { value: 'click', type: 'string' },
535+
count: { value: 2, type: 'integer' },
536+
},
537+
},
538+
],
539+
},
540+
})
541+
.start();
542+
543+
await runner.completed();
544+
});
494545
});

packages/astro/src/integration/index.ts

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ export const sentryAstro = (options: SentryOptions = {}): AstroIntegration => {
163163
}
164164

165165
const isCloudflare = config?.adapter?.name?.startsWith('@astrojs/cloudflare');
166+
const isCloudflareWorkers = isCloudflare && !isCloudflarePages();
166167

167168
if (isCloudflare) {
168169
try {
@@ -191,8 +192,8 @@ export const sentryAstro = (options: SentryOptions = {}): AstroIntegration => {
191192
injectScript('page-ssr', buildServerSnippet(options || {}));
192193
}
193194

194-
if (isCloudflare && command !== 'dev') {
195-
// For Cloudflare production builds, additionally use a Vite plugin to:
195+
if (isCloudflareWorkers && command !== 'dev') {
196+
// For Cloudflare Workers production builds, additionally use a Vite plugin to:
196197
// 1. Import the server config at the Worker entry level (so Sentry.init() runs
197198
// for ALL requests, not just SSR pages — covers actions and API routes)
198199
// 2. Wrap the default export with `withSentry` from @sentry/cloudflare for
@@ -215,6 +216,7 @@ export const sentryAstro = (options: SentryOptions = {}): AstroIntegration => {
215216
// Ref: https://developers.cloudflare.com/workers/runtime-apis/nodejs/
216217
updateConfig({
217218
vite: {
219+
plugins: [sentryCloudflareNodeWarningPlugin()],
218220
ssr: {
219221
// @sentry/node is required in case we have 2 different @sentry/node
220222
// packages installed in the same project.
@@ -255,6 +257,41 @@ function findDefaultSdkInitFile(type: 'server' | 'client'): string | undefined {
255257
.find(filename => fs.existsSync(filename));
256258
}
257259

260+
/**
261+
* Detects if the project is a Cloudflare Pages project by checking for
262+
* `pages_build_output_dir` in the wrangler configuration file.
263+
*
264+
* Cloudflare Pages projects use `pages_build_output_dir` while Workers projects
265+
* use `assets.directory` or `main` fields instead.
266+
*/
267+
function isCloudflarePages(): boolean {
268+
const cwd = process.cwd();
269+
const configFiles = ['wrangler.jsonc', 'wrangler.json', 'wrangler.toml'];
270+
271+
for (const configFile of configFiles) {
272+
const configPath = path.join(cwd, configFile);
273+
274+
if (!fs.existsSync(configPath)) {
275+
continue;
276+
}
277+
278+
const content = fs.readFileSync(configPath, 'utf-8');
279+
280+
if (configFile.endsWith('.toml')) {
281+
// https://regex101.com/r/Uxe4p0/1
282+
// Match pages_build_output_dir as a TOML key (at start of line, ignoring whitespace)
283+
// This avoids false positives from comments (lines starting with #)
284+
return /^\s*pages_build_output_dir\s*=/m.test(content);
285+
}
286+
287+
// Match "pages_build_output_dir" as a JSON key (followed by :)
288+
// This works for both .json and .jsonc without needing to strip comments
289+
return /"pages_build_output_dir"\s*:/.test(content);
290+
}
291+
292+
return false;
293+
}
294+
258295
function getSourcemapsAssetsGlob(config: AstroConfig): string {
259296
// The vercel adapter puts the output into its .vercel directory
260297
// However, the way this adapter is written, the config.outDir value is update too late for

0 commit comments

Comments
 (0)