Skip to content

Commit

Permalink
Merge branch 'develop' into kw-rn-profiling-share-code
Browse files Browse the repository at this point in the history
  • Loading branch information
krystofwoldrich authored Jun 20, 2023
2 parents f361c81 + 50ead24 commit 528999c
Show file tree
Hide file tree
Showing 54 changed files with 506 additions and 1,193 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@

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

## 7.56.0

- feat(replay): Rework slow click & multi click detection (#8322)
- feat(replay): Stop replay when event buffer exceeds max. size (#8315)
- feat(replay): Consider `window.open` for slow clicks (#8308)
- fix(core): Temporarily store debug IDs in stack frame and only put them into `debug_meta` before sending (#8347)
- fix(remix): Extract deferred responses correctly in root loaders. (#8305)
- fix(vue): Don't call `next` in Vue router 4 instrumentation (#8351)

## 7.55.2

- fix(replay): Stop exporting `EventType` from `@sentry-internal/rrweb` (#8334)
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
"version": "7.55.2",
"version": "7.56.0",
"npmClient": "yarn",
"useWorkspaces": true
}
8 changes: 4 additions & 4 deletions packages/angular-ivy/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sentry/angular-ivy",
"version": "7.55.2",
"version": "7.56.0",
"description": "Official Sentry SDK for Angular with full Ivy Support",
"repository": "git://github.com/getsentry/sentry-javascript.git",
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/angular-ivy",
Expand All @@ -21,9 +21,9 @@
"rxjs": "^6.5.5 || ^7.x"
},
"dependencies": {
"@sentry/browser": "7.55.2",
"@sentry/types": "7.55.2",
"@sentry/utils": "7.55.2",
"@sentry/browser": "7.56.0",
"@sentry/types": "7.56.0",
"@sentry/utils": "7.56.0",
"tslib": "^2.3.0"
},
"devDependencies": {
Expand Down
8 changes: 4 additions & 4 deletions packages/angular/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sentry/angular",
"version": "7.55.2",
"version": "7.56.0",
"description": "Official Sentry SDK for Angular",
"repository": "git://github.com/getsentry/sentry-javascript.git",
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/angular",
Expand All @@ -21,9 +21,9 @@
"rxjs": "^6.5.5 || ^7.x"
},
"dependencies": {
"@sentry/browser": "7.55.2",
"@sentry/types": "7.55.2",
"@sentry/utils": "7.55.2",
"@sentry/browser": "7.56.0",
"@sentry/types": "7.56.0",
"@sentry/utils": "7.56.0",
"tslib": "^2.0.0"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/browser-integration-tests/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sentry-internal/browser-integration-tests",
"version": "7.55.2",
"version": "7.56.0",
"main": "index.js",
"license": "MIT",
"engines": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ sentryTest(
let errorEventId: string | undefined;
const reqPromise0 = waitForReplayRequest(page, 0);
const reqPromise1 = waitForReplayRequest(page, 1);
const reqPromise2 = waitForReplayRequest(page, 2);
const reqErrorPromise = waitForErrorRequest(page);

await page.route('https://dsn.ingest.sentry.io/**/*', route => {
Expand Down Expand Up @@ -101,18 +100,14 @@ sentryTest(

// Switches to session mode and then goes to background
const req1 = await reqPromise1;
const req2 = await reqPromise2;
expect(callsToSentry).toBeGreaterThanOrEqual(5);
expect(callsToSentry).toBeGreaterThanOrEqual(4);

const event0 = getReplayEvent(req0);
const content0 = getReplayRecordingContent(req0);

const event1 = getReplayEvent(req1);
const content1 = getReplayRecordingContent(req1);

const event2 = getReplayEvent(req2);
const content2 = getReplayRecordingContent(req2);

expect(event0).toEqual(
getExpectedReplayEvent({
error_ids: [errorEventId!],
Expand Down Expand Up @@ -157,17 +152,7 @@ sentryTest(

// From switching to session mode
expect(content1.fullSnapshots).toHaveLength(1);

expect(event2).toEqual(
getExpectedReplayEvent({
replay_type: 'buffer', // although we're in session mode, we still send 'buffer' as replay_type
segment_id: 2,
urls: [],
}),
);

expect(content2.fullSnapshots).toHaveLength(0);
expect(content2.breadcrumbs).toEqual(expect.arrayContaining([expectedClickBreadcrumb]));
expect(content1.breadcrumbs).toEqual(expect.arrayContaining([expectedClickBreadcrumb]));
},
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ sentryTest(
}

const reqPromise0 = waitForReplayRequest(page, 0);
const reqPromise1 = waitForReplayRequest(page, 1);

await page.route('https://dsn.ingest.sentry.io/**/*', route => {
return route.fulfill({
Expand All @@ -39,7 +38,7 @@ sentryTest(

await page.goto(url);

await reqPromise0;
const res = await reqPromise0;

await page.setInputFiles('#file-input', {
name: 'file.csv',
Expand All @@ -49,9 +48,7 @@ sentryTest(

await forceFlushReplay();

const res1 = await reqPromise1;

const snapshots = getIncrementalRecordingSnapshots(res1).filter(isInputMutation);
const snapshots = getIncrementalRecordingSnapshots(res).filter(isInputMutation);

expect(snapshots).toEqual([]);
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ sentryTest(
}

const reqPromise0 = waitForReplayRequest(page, 0);
const reqPromise0b = waitForReplayRequest(page, 1);

await page.route('https://dsn.ingest.sentry.io/**/*', route => {
return route.fulfill({
Expand All @@ -24,10 +23,7 @@ sentryTest(
const url = await getLocalTestPath({ testDir: __dirname });

await page.goto(url);
await forceFlushReplay();
const res0 = await reqPromise0;
await reqPromise0b;
// A second request is sent right after initial snapshot, we want to wait for that to settle before we continue

const reqPromise1 = waitForReplayRequest(page);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ sentryTest(
}

const reqPromise0 = waitForReplayRequest(page, 0);
const reqPromise0b = waitForReplayRequest(page, 1);

await page.route('https://dsn.ingest.sentry.io/**/*', route => {
return route.fulfill({
Expand All @@ -30,8 +29,6 @@ sentryTest(

await page.goto(url);
const res0 = await reqPromise0;
await reqPromise0b;
// A second request is sent right after initial snapshot, we want to wait for that to settle before we continue

const reqPromise1 = waitForReplayRequest(page);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { expect } from '@playwright/test';
import { sentryTest } from '../../../../utils/fixtures';
import { getCustomRecordingEvents, shouldSkipReplayTest, waitForReplayRequest } from '../../../../utils/replayHelpers';

sentryTest('mutation after threshold results in slow click', async ({ getLocalTestUrl, page }) => {
sentryTest('mutation after threshold results in slow click', async ({ forceFlushReplay, getLocalTestUrl, page }) => {
if (shouldSkipReplayTest()) {
sentryTest.skip();
}
Expand All @@ -21,6 +21,7 @@ sentryTest('mutation after threshold results in slow click', async ({ getLocalTe
const url = await getLocalTestUrl({ testDir: __dirname });

await page.goto(url);
await forceFlushReplay();
await reqPromise0;

const reqPromise1 = waitForReplayRequest(page, (event, res) => {
Expand Down Expand Up @@ -125,59 +126,63 @@ sentryTest('multiple clicks are counted', async ({ getLocalTestUrl, page }) => {
expect(slowClickBreadcrumbs[0]?.data?.timeAfterClickMs).toBeLessThan(3100);
});

sentryTest('immediate mutation does not trigger slow click', async ({ browserName, getLocalTestUrl, page }) => {
// This test seems to only be flakey on firefox
if (shouldSkipReplayTest() || ['firefox'].includes(browserName)) {
sentryTest.skip();
}

const reqPromise0 = waitForReplayRequest(page, 0);

await page.route('https://dsn.ingest.sentry.io/**/*', route => {
return route.fulfill({
status: 200,
contentType: 'application/json',
body: JSON.stringify({ id: 'test-id' }),
sentryTest(
'immediate mutation does not trigger slow click',
async ({ forceFlushReplay, browserName, getLocalTestUrl, page }) => {
// This test seems to only be flakey on firefox
if (shouldSkipReplayTest() || ['firefox'].includes(browserName)) {
sentryTest.skip();
}

const reqPromise0 = waitForReplayRequest(page, 0);

await page.route('https://dsn.ingest.sentry.io/**/*', route => {
return route.fulfill({
status: 200,
contentType: 'application/json',
body: JSON.stringify({ id: 'test-id' }),
});
});
});

const url = await getLocalTestUrl({ testDir: __dirname });
const url = await getLocalTestUrl({ testDir: __dirname });

await page.goto(url);
await reqPromise0;
await page.goto(url);
await forceFlushReplay();
await reqPromise0;

const reqPromise1 = waitForReplayRequest(page, (event, res) => {
const { breadcrumbs } = getCustomRecordingEvents(res);
const reqPromise1 = waitForReplayRequest(page, (event, res) => {
const { breadcrumbs } = getCustomRecordingEvents(res);

return breadcrumbs.some(breadcrumb => breadcrumb.category === 'ui.click');
});

await page.click('#mutationButtonImmediately');

const { breadcrumbs } = getCustomRecordingEvents(await reqPromise1);
return breadcrumbs.some(breadcrumb => breadcrumb.category === 'ui.click');
});

expect(breadcrumbs).toEqual([
{
category: 'ui.click',
data: {
node: {
attributes: {
id: 'mutationButtonImmediately',
await page.click('#mutationButtonImmediately');

const { breadcrumbs } = getCustomRecordingEvents(await reqPromise1);

expect(breadcrumbs).toEqual([
{
category: 'ui.click',
data: {
node: {
attributes: {
id: 'mutationButtonImmediately',
},
id: expect.any(Number),
tagName: 'button',
textContent: '******* ******** ***********',
},
id: expect.any(Number),
tagName: 'button',
textContent: '******* ******** ***********',
nodeId: expect.any(Number),
},
nodeId: expect.any(Number),
message: 'body > button#mutationButtonImmediately',
timestamp: expect.any(Number),
type: 'default',
},
message: 'body > button#mutationButtonImmediately',
timestamp: expect.any(Number),
type: 'default',
},
]);
});
]);
},
);

sentryTest('inline click handler does not trigger slow click', async ({ getLocalTestUrl, page }) => {
sentryTest('inline click handler does not trigger slow click', async ({ forceFlushReplay, getLocalTestUrl, page }) => {
if (shouldSkipReplayTest()) {
sentryTest.skip();
}
Expand All @@ -195,6 +200,7 @@ sentryTest('inline click handler does not trigger slow click', async ({ getLocal
const url = await getLocalTestUrl({ testDir: __dirname });

await page.goto(url);
await forceFlushReplay();
await reqPromise0;

const reqPromise1 = waitForReplayRequest(page, (event, res) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,19 @@ sentryTest(
const url = await getLocalTestUrl({ testDir: __dirname });

await page.goto(url);
await reqPromise0;
await forceFlushReplay();
const res0 = getCustomRecordingEvents(await reqPromise0);

await page.click('[data-console]');
await forceFlushReplay();

const { breadcrumbs } = getCustomRecordingEvents(await reqPromise1);
const res1 = getCustomRecordingEvents(await reqPromise1);

// 1 click breadcrumb + 1 throttled breadcrumb is why console logs are less
// than throttle limit
expect(breadcrumbs.length).toBe(THROTTLE_LIMIT);
const breadcrumbs = [...res0.breadcrumbs, ...res1.breadcrumbs];
const spans = [...res0.performanceSpans, ...res1.performanceSpans];
expect(breadcrumbs.filter(breadcrumb => breadcrumb.category === 'replay.throttled').length).toBe(1);
// replay.throttled breadcrumb does *not* use the throttledAddEvent as we
// alwants want that breadcrumb to be present in replay
expect(breadcrumbs.length + spans.length).toBe(THROTTLE_LIMIT + 1);
},
);
14 changes: 7 additions & 7 deletions packages/browser/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sentry/browser",
"version": "7.55.2",
"version": "7.56.0",
"description": "Official Sentry SDK for browsers",
"repository": "git://github.com/getsentry/sentry-javascript.git",
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/browser",
Expand All @@ -16,15 +16,15 @@
"access": "public"
},
"dependencies": {
"@sentry-internal/tracing": "7.55.2",
"@sentry/core": "7.55.2",
"@sentry/replay": "7.55.2",
"@sentry/types": "7.55.2",
"@sentry/utils": "7.55.2",
"@sentry-internal/tracing": "7.56.0",
"@sentry/core": "7.56.0",
"@sentry/replay": "7.56.0",
"@sentry/types": "7.56.0",
"@sentry/utils": "7.56.0",
"tslib": "^1.9.3"
},
"devDependencies": {
"@sentry-internal/integration-shims": "7.55.2",
"@sentry-internal/integration-shims": "7.56.0",
"@types/md5": "2.1.33",
"btoa": "^1.2.1",
"chai": "^4.1.2",
Expand Down
6 changes: 3 additions & 3 deletions packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sentry/core",
"version": "7.55.2",
"version": "7.56.0",
"description": "Base implementation for all Sentry JavaScript SDKs",
"repository": "git://github.com/getsentry/sentry-javascript.git",
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/core",
Expand All @@ -16,8 +16,8 @@
"access": "public"
},
"dependencies": {
"@sentry/types": "7.55.2",
"@sentry/utils": "7.55.2",
"@sentry/types": "7.56.0",
"@sentry/utils": "7.56.0",
"tslib": "^1.9.3"
},
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const SDK_VERSION = '7.55.2';
export const SDK_VERSION = '7.56.0';
Loading

0 comments on commit 528999c

Please sign in to comment.