Skip to content

Commit

Permalink
Merge pull request #8602 from getsentry/prepare-release/7.60.0
Browse files Browse the repository at this point in the history
meta(changelog): Update changelog for 7.60.0
  • Loading branch information
mydea authored Jul 21, 2023
2 parents 13c3a02 + 6aa95c7 commit 9ff9e3f
Show file tree
Hide file tree
Showing 94 changed files with 587 additions and 163 deletions.
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,27 @@

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

## 7.60.0

### Important Changes

- **feat(replay): Ensure min/max duration when flushing (#8596)**

We will not send replays that are <5s long anymore. Additionally, we also added further safeguards to avoid overly long (>1h) replays.
You can optionally configure the min. replay duration (defaults to 5s):

```js
new Replay({
minReplayDuration: 10000 // in ms - note that this is capped at 15s max!
})
```

### Other Changes

- fix(profiling): Align to SDK selected time origin (#8599)
- fix(replay): Ensure multi click has correct timestamps (#8591)
- fix(utils): Truncate aggregate exception values (LinkedErrors) (#8593)

## 7.59.3

- fix(browser): 0 is a valid index (#8581)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
import { expect } from '@playwright/test';

import { sentryTest } from '../../../../utils/fixtures';
import { envelopeRequestParser, waitForErrorRequest } from '../../../../utils/helpers';
import { envelopeRequestParser, waitForErrorRequestOnUrl } from '../../../../utils/helpers';

sentryTest('captureException works', async ({ getLocalTestUrl, page }) => {
const req = waitForErrorRequest(page);

const url = await getLocalTestUrl({ testDir: __dirname });
await page.goto(url);
const req = await waitForErrorRequestOnUrl(page, url);

const eventData = envelopeRequestParser(await req);
const eventData = envelopeRequestParser(req);

expect(eventData.message).toBe('Test exception');
});
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
import { expect } from '@playwright/test';

import { sentryTest } from '../../../../utils/fixtures';
import { envelopeRequestParser, waitForErrorRequest } from '../../../../utils/helpers';
import { envelopeRequestParser, waitForErrorRequestOnUrl } from '../../../../utils/helpers';

sentryTest('error handler works with a recursive custom error handler', async ({ getLocalTestUrl, page }) => {
const req = waitForErrorRequest(page);

const url = await getLocalTestUrl({ testDir: __dirname });
await page.goto(url);
const req = await waitForErrorRequestOnUrl(page, url);

const eventData = envelopeRequestParser(await req);
const eventData = envelopeRequestParser(req);
expect(eventData.exception?.values?.length).toBe(1);
expect(eventData.exception?.values?.[0]?.value).toBe('window.doSomethingWrong is not a function');
});
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
import { expect } from '@playwright/test';

import { sentryTest } from '../../../../utils/fixtures';
import { envelopeRequestParser,waitForErrorRequest } from '../../../../utils/helpers';
import { envelopeRequestParser, waitForErrorRequestOnUrl } from '../../../../utils/helpers';

sentryTest('error handler works', async ({ getLocalTestUrl, page }) => {
const req = waitForErrorRequest(page);

const url = await getLocalTestUrl({ testDir: __dirname });
await page.goto(url);
const req = await waitForErrorRequestOnUrl(page, url);

const eventData = envelopeRequestParser(await req);
const eventData = envelopeRequestParser(req);
expect(eventData.exception?.values?.length).toBe(1);
expect(eventData.exception?.values?.[0]?.value).toBe('window.doSomethingWrong is not a function');
});
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
import { expect } from '@playwright/test';

import { sentryTest } from '../../../../utils/fixtures';
import { envelopeRequestParser,waitForErrorRequest } from '../../../../utils/helpers';
import { envelopeRequestParser, waitForErrorRequestOnUrl } from '../../../../utils/helpers';

sentryTest('error handler works for later errors', async ({ getLocalTestUrl, page }) => {
const req = waitForErrorRequest(page);

const url = await getLocalTestUrl({ testDir: __dirname });
await page.goto(url);
const req = await waitForErrorRequestOnUrl(page, url);

const eventData = envelopeRequestParser(await req);
const eventData = envelopeRequestParser(req);

expect(eventData.exception?.values?.length).toBe(1);
expect(eventData.exception?.values?.[0]?.value).toBe('window.doSomethingWrong is not a function');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
import { expect } from '@playwright/test';

import { sentryTest } from '../../../../utils/fixtures';
import { envelopeRequestParser,shouldSkipTracingTest, waitForTransactionRequest } from '../../../../utils/helpers';
import {
envelopeRequestParser,
shouldSkipTracingTest,
waitForTransactionRequestOnUrl,
} from '../../../../utils/helpers';

sentryTest('should create a pageload transaction', async ({ getLocalTestUrl, page }) => {
if (shouldSkipTracingTest()) {
sentryTest.skip();
}

const req = waitForTransactionRequest(page);

const url = await getLocalTestUrl({ testDir: __dirname });
await page.goto(url);
const req = await waitForTransactionRequestOnUrl(page, url);

const eventData = envelopeRequestParser(await req);
const eventData = envelopeRequestParser(req);
const timeOrigin = await page.evaluate<number>('window._testBaseTimestamp');

const { start_timestamp: startTimestamp } = eventData;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import path from 'path';

import { sentryTest, TEST_HOST } from '../../../../utils/fixtures';
import { LOADER_CONFIGS } from '../../../../utils/generatePlugin';
import { envelopeRequestParser, waitForErrorRequest } from '../../../../utils/helpers';
import { envelopeRequestParser, waitForErrorRequestOnUrl } from '../../../../utils/helpers';

const bundle = process.env.PW_BUNDLE || '';
const isLazy = LOADER_CONFIGS[bundle]?.lazy;
Expand Down Expand Up @@ -40,13 +40,10 @@ sentryTest('it does not download the SDK if the SDK was loaded in the meanwhile'
return fs.existsSync(filePath) ? route.fulfill({ path: filePath }) : route.continue();
});

const req = waitForErrorRequest(page);

const url = await getLocalTestUrl({ testDir: __dirname, skipRouteHandler: true });
const req = await waitForErrorRequestOnUrl(page, url);

await page.goto(url);

const eventData = envelopeRequestParser(await req);
const eventData = envelopeRequestParser(req);

await waitForFunction(() => cdnLoadedCount === 2);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
import { expect } from '@playwright/test';

import { sentryTest } from '../../../../utils/fixtures';
import { envelopeRequestParser, waitForErrorRequest } from '../../../../utils/helpers';
import { envelopeRequestParser, waitForErrorRequestOnUrl } from '../../../../utils/helpers';

sentryTest('captureException works', async ({ getLocalTestUrl, page }) => {
const req = waitForErrorRequest(page);

const url = await getLocalTestUrl({ testDir: __dirname });
await page.goto(url);
const req = await waitForErrorRequestOnUrl(page, url);

const eventData = envelopeRequestParser(await req);
const eventData = envelopeRequestParser(req);

expect(eventData.message).toBe('Test exception');
});
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
import { expect } from '@playwright/test';

import { sentryTest } from '../../../../utils/fixtures';
import { envelopeRequestParser, waitForErrorRequest } from '../../../../utils/helpers';
import { envelopeRequestParser, waitForErrorRequestOnUrl } from '../../../../utils/helpers';

sentryTest('captureException works inside of onLoad', async ({ getLocalTestUrl, page }) => {
const req = waitForErrorRequest(page);

const url = await getLocalTestUrl({ testDir: __dirname });
await page.goto(url);
const req = await waitForErrorRequestOnUrl(page, url);

const eventData = envelopeRequestParser(await req);
const eventData = envelopeRequestParser(req);

expect(eventData.message).toBe('Test exception');
});
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
import { expect } from '@playwright/test';

import { sentryTest } from '../../../../utils/fixtures';
import { envelopeRequestParser, shouldSkipTracingTest, waitForTransactionRequest } from '../../../../utils/helpers';
import {
envelopeRequestParser,
shouldSkipTracingTest,
waitForTransactionRequestOnUrl,
} from '../../../../utils/helpers';

sentryTest('should handle custom added BrowserTracing integration', async ({ getLocalTestUrl, page }) => {
if (shouldSkipTracingTest()) {
sentryTest.skip();
}

const req = waitForTransactionRequest(page);

const url = await getLocalTestUrl({ testDir: __dirname });
await page.goto(url);
const req = await waitForTransactionRequestOnUrl(page, url);

const eventData = envelopeRequestParser(await req);
const eventData = envelopeRequestParser(req);
const timeOrigin = await page.evaluate<number>('window._testBaseTimestamp');

const { start_timestamp: startTimestamp } = eventData;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
import { expect } from '@playwright/test';

import { sentryTest } from '../../../../utils/fixtures';
import { envelopeRequestParser, waitForErrorRequest } from '../../../../utils/helpers';
import { envelopeRequestParser, waitForErrorRequestOnUrl } from '../../../../utils/helpers';

sentryTest('error handler works', async ({ getLocalTestUrl, page }) => {
const req = waitForErrorRequest(page);

const url = await getLocalTestUrl({ testDir: __dirname });
await page.goto(url);
const req = await waitForErrorRequestOnUrl(page, url);

const eventData = envelopeRequestParser(await req);
const eventData = envelopeRequestParser(req);

expect(eventData.exception?.values?.length).toBe(1);
expect(eventData.exception?.values?.[0]?.value).toBe('window.doSomethingWrong is not a function');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
import { expect } from '@playwright/test';

import { sentryTest } from '../../../../utils/fixtures';
import { envelopeRequestParser,waitForErrorRequest } from '../../../../utils/helpers';
import { envelopeRequestParser, waitForErrorRequestOnUrl } from '../../../../utils/helpers';

sentryTest('error handler works for later errors', async ({ getLocalTestUrl, page }) => {
const req = waitForErrorRequest(page);

const url = await getLocalTestUrl({ testDir: __dirname });
await page.goto(url);
const req = await waitForErrorRequestOnUrl(page, url);

const eventData = envelopeRequestParser(await req);
const eventData = envelopeRequestParser(req);

expect(eventData.exception?.values?.length).toBe(1);
expect(eventData.exception?.values?.[0]?.value).toBe('window.doSomethingWrong is not a function');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
import { expect } from '@playwright/test';

import { sentryTest } from '../../../../utils/fixtures';
import { envelopeRequestParser,shouldSkipTracingTest, waitForTransactionRequest } from '../../../../utils/helpers';
import {
envelopeRequestParser,
shouldSkipTracingTest,
waitForTransactionRequestOnUrl,
} from '../../../../utils/helpers';

sentryTest('should create a pageload transaction', async ({ getLocalTestUrl, page }) => {
if (shouldSkipTracingTest()) {
sentryTest.skip();
}

const req = waitForTransactionRequest(page);

const url = await getLocalTestUrl({ testDir: __dirname });
await page.goto(url);
const req = await waitForTransactionRequestOnUrl(page, url);

const eventData = envelopeRequestParser(await req);
const eventData = envelopeRequestParser(req);
const timeOrigin = await page.evaluate<number>('window._testBaseTimestamp');

const { start_timestamp: startTimestamp } = eventData;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ import * as path from 'path';
import * as childProcess from 'child_process';
import { promisify } from 'util';

const exec = promisify(childProcess.exec);

async function run(): Promise<void> {
let testPaths: string[] = [];

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
const wat = new Error(`This is a very long message that should be truncated and will be,
this is a very long message that should be truncated and will be,
this is a very long message that should be truncated and will be,
this is a very long message that should be truncated and will be,
this is a very long message that should be truncated and will be`);

wat.cause = new Error(`This is a very long message that should be truncated and hopefully will be,
this is a very long message that should be truncated and hopefully will be,
this is a very long message that should be truncated and hopefully will be,
this is a very long message that should be truncated and hopefully will be,
this is a very long message that should be truncated and hopefully will be,`);

Sentry.captureException(wat);
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import { expect } from '@playwright/test';
import type { Event } from '@sentry/types';

import { sentryTest } from '../../../../utils/fixtures';
import { getFirstSentryEnvelopeRequest } from '../../../../utils/helpers';

sentryTest('should capture a linked error with messages', async ({ getLocalTestPath, page }) => {
const url = await getLocalTestPath({ testDir: __dirname });

const eventData = await getFirstSentryEnvelopeRequest<Event>(page, url);

expect(eventData.exception?.values).toHaveLength(2);
expect(eventData.exception?.values?.[0]).toMatchObject({
type: 'Error',
value: `This is a very long message that should be truncated and hopefully will be,
this is a very long message that should be truncated and hopefully will be,
this is a very long message that should be truncated and hopefully will be,
this is a very long me...`,
mechanism: {
type: 'chained',
handled: true,
},
stacktrace: {
frames: expect.any(Array),
},
});
expect(eventData.exception?.values?.[1]).toMatchObject({
type: 'Error',
value: `This is a very long message that should be truncated and will be,
this is a very long message that should be truncated and will be,
this is a very long message that should be truncated and will be,
this is a very long message that should be truncated...`,
mechanism: {
type: 'generic',
handled: true,
},
stacktrace: {
frames: expect.any(Array),
},
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ import * as Sentry from '@sentry/browser';

window.Sentry = Sentry;
window.Replay = new Sentry.Replay({
flushMinDelay: 1000,
flushMaxDelay: 1000,
flushMinDelay: 200,
flushMaxDelay: 200,
minReplayDuration: 0,
});

Sentry.init({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ window.Sentry = Sentry;
window.Replay = new Replay({
flushMinDelay: 200,
flushMaxDelay: 200,
minReplayDuration: 0,
});

Sentry.init({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ import * as Sentry from '@sentry/browser';

window.Sentry = Sentry;
window.Replay = new Sentry.Replay({
flushMinDelay: 500,
flushMaxDelay: 500,
flushMinDelay: 200,
flushMaxDelay: 200,
minReplayDuration: 0,
useCompression: true,
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ import * as Sentry from '@sentry/browser';

window.Sentry = Sentry;
window.Replay = new Sentry.Replay({
flushMinDelay: 500,
flushMaxDelay: 500,
flushMinDelay: 200,
flushMaxDelay: 200,
minReplayDuration: 0,
useCompression: false,
blockAllMedia: false,
});
Expand Down
Loading

0 comments on commit 9ff9e3f

Please sign in to comment.