Skip to content

Commit c59e752

Browse files
committed
fix: metadata processing
1 parent f997961 commit c59e752

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

dev-packages/e2e-tests/test-applications/nextjs-13/tests/client/sessions.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ test('should report healthy sessions', async ({ page }) => {
55
test.skip(process.env.TEST_ENV === 'development', 'test is flakey in dev mode');
66

77
const sessionPromise = waitForSession('nextjs-13', session => {
8-
console.log('session', session);
98
return session.init === true && session.status === 'ok' && session.errors === 0;
109
});
1110

dev-packages/e2e-tests/test-applications/nextjs-13/tests/server/pages-router-api-endpoints.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ test('Should report an error event for errors thrown in pages router api routes'
6969
request: {
7070
headers: expect.any(Object),
7171
method: 'GET',
72-
url: expect.stringMatching(/^\/api\/foo\/failure-api-route$/),
72+
url: expect.stringMatching(/^http.*\/api\/foo\/failure-api-route$/),
7373
},
7474
start_timestamp: expect.any(Number),
7575
timestamp: expect.any(Number),
@@ -112,7 +112,7 @@ test('Should report a transaction event for a successful pages router api route'
112112
request: {
113113
headers: expect.any(Object),
114114
method: 'GET',
115-
url: expect.stringMatching(/^\/api\/foo\/success-api-route$/),
115+
url: expect.stringMatching(/^http.*\/api\/foo\/success-api-route$/),
116116
},
117117
start_timestamp: expect.any(Number),
118118
timestamp: expect.any(Number),

packages/nextjs/src/common/pages-router-instrumentation/wrapApiHandlerWithSentry.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,10 @@ export function wrapApiHandlerWithSentry(apiHandler: NextApiHandler, parameteriz
5454
const method = req.method || 'GET';
5555
getCurrentScope().setTransactionName(`${method} ${parameterizedRoute}`);
5656

57-
// Set SDK processing metadata for session tracking (needed even without tracing)
58-
const normalizedRequest = httpRequestToRequestData(req);
59-
getIsolationScope().setSDKProcessingMetadata({ normalizedRequest });
57+
// Set SDK processing metadata
58+
getIsolationScope().setSDKProcessingMetadata({
59+
normalizedRequest: httpRequestToRequestData(req),
60+
});
6061

6162
return await wrappingTarget.apply(thisArg, args);
6263
} catch (e) {

0 commit comments

Comments
 (0)