From 99d0bda2918a2664745e0cfd8d5f140f56eada64 Mon Sep 17 00:00:00 2001 From: Francesco Novy Date: Tue, 8 Oct 2024 13:03:02 +0200 Subject: [PATCH] fix & increase size limit --- .size-limit.js | 2 +- .../suites/replay/dsc/test.ts | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.size-limit.js b/.size-limit.js index 5da293511976..8a7670e6d638 100644 --- a/.size-limit.js +++ b/.size-limit.js @@ -180,7 +180,7 @@ module.exports = [ name: 'CDN Bundle (incl. Tracing, Replay)', path: createCDNPath('bundle.tracing.replay.min.js'), gzip: true, - limit: '73 KB', + limit: '74 KB', }, { name: 'CDN Bundle (incl. Tracing, Replay, Feedback)', diff --git a/dev-packages/browser-integration-tests/suites/replay/dsc/test.ts b/dev-packages/browser-integration-tests/suites/replay/dsc/test.ts index d4721ea9998c..be3a900edea2 100644 --- a/dev-packages/browser-integration-tests/suites/replay/dsc/test.ts +++ b/dev-packages/browser-integration-tests/suites/replay/dsc/test.ts @@ -227,6 +227,8 @@ sentryTest('should add replay_id to error DSC while replay is active', async ({ sentryTest.skip(); } + const hasTracing = !shouldSkipTracingTest(); + await page.route('https://dsn.ingest.sentry.io/**/*', route => { return route.fulfill({ status: 200, @@ -242,7 +244,7 @@ sentryTest('should add replay_id to error DSC while replay is active', async ({ const error2Req = waitForErrorRequest(page, event => event.exception?.values?.[0].value === 'This is error #2'); // We want to wait for the transaction to be done, to ensure we have a consistent test - const transactionReq = shouldSkipTracingTest() ? Promise.resolve() : waitForTransactionRequest(page); + const transactionReq = hasTracing ? waitForTransactionRequest(page) : Promise.resolve(); // Wait for this to be available await page.waitForFunction('!!window.Replay'); @@ -262,11 +264,15 @@ sentryTest('should add replay_id to error DSC while replay is active', async ({ expect(error1Header.trace).toBeDefined(); expect(error1Header.trace).toEqual({ environment: 'production', - sample_rate: '1', trace_id: expect.any(String), public_key: 'public', replay_id: replay.session?.id, - sampled: 'true', + ...(hasTracing + ? { + sample_rate: '1', + sampled: 'true', + } + : {}), }); // Now end replay and trigger another error, it should not have a replay_id in DSC anymore