Skip to content

Commit 5d7684c

Browse files
committed
remove isNotScroll filter
1 parent 903757e commit 5d7684c

File tree

6 files changed

+64
-75
lines changed

6 files changed

+64
-75
lines changed

packages/rrweb-snapshot/test/snapshot.test.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,12 @@ describe('transformAttribute()', () => {
158158

159159
describe('isBlockedElement()', () => {
160160
const subject = (html: string, opt: any = {}) =>
161-
_isBlockedElement(render(html), 'rr-block', opt.blockSelector, opt.unblockSelector);
161+
_isBlockedElement(
162+
render(html),
163+
'rr-block',
164+
opt.blockSelector,
165+
opt.unblockSelector,
166+
);
162167

163168
const render = (html: string): HTMLElement =>
164169
JSDOM.fragment(html).querySelector('div')!;

packages/rrweb/test/__snapshots__/integration.test.ts.snap

Lines changed: 42 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -2789,7 +2789,7 @@ exports[`record integration tests can record form interactions 1`] = `
27892789
\\"type\\": 3,
27902790
\\"data\\": {
27912791
\\"source\\": 5,
2792-
\\"text\\": \\"\\",
2792+
\\"text\\": \\"AA\\",
27932793
\\"isChecked\\": false,
27942794
\\"id\\": 62
27952795
}
@@ -5335,7 +5335,7 @@ exports[`record integration tests can use maskInputOptions to configure which ty
53355335
\\"type\\": 3,
53365336
\\"data\\": {
53375337
\\"source\\": 5,
5338-
\\"text\\": \\"\\",
5338+
\\"text\\": \\"AA\\",
53395339
\\"isChecked\\": false,
53405340
\\"id\\": 62
53415341
}
@@ -6105,7 +6105,7 @@ exports[`record integration tests can use maskTextSelector to configure which in
61056105
\\"type\\": 3,
61066106
\\"data\\": {
61076107
\\"source\\": 5,
6108-
\\"text\\": \\"\\",
6108+
\\"text\\": \\"AA\\",
61096109
\\"isChecked\\": false,
61106110
\\"id\\": 62
61116111
}
@@ -12235,28 +12235,28 @@ exports[`record integration tests should not record input values if dynamically
1223512235
{
1223612236
\\"type\\": 3,
1223712237
\\"data\\": {
12238-
\\"source\\": 5,
12239-
\\"text\\": \\"************************\\",
12240-
\\"isChecked\\": false,
12241-
\\"id\\": 21
12238+
\\"source\\": 3,
12239+
\\"id\\": 21,
12240+
\\"x\\": 12.5,
12241+
\\"y\\": 0
1224212242
}
1224312243
},
1224412244
{
1224512245
\\"type\\": 3,
1224612246
\\"data\\": {
1224712247
\\"source\\": 5,
12248-
\\"text\\": \\"*************************\\",
12248+
\\"text\\": \\"************************\\",
1224912249
\\"isChecked\\": false,
1225012250
\\"id\\": 21
1225112251
}
1225212252
},
1225312253
{
1225412254
\\"type\\": 3,
1225512255
\\"data\\": {
12256-
\\"source\\": 3,
12257-
\\"id\\": 21,
12258-
\\"x\\": 27.5,
12259-
\\"y\\": 0
12256+
\\"source\\": 5,
12257+
\\"text\\": \\"*************************\\",
12258+
\\"isChecked\\": false,
12259+
\\"id\\": 21
1226012260
}
1226112261
}
1226212262
]"
@@ -12474,6 +12474,15 @@ exports[`record integration tests should not record input values if dynamically
1247412474
\\"id\\": 21
1247512475
}
1247612476
},
12477+
{
12478+
\\"type\\": 3,
12479+
\\"data\\": {
12480+
\\"source\\": 3,
12481+
\\"id\\": 21,
12482+
\\"x\\": 12.5,
12483+
\\"y\\": 0
12484+
}
12485+
},
1247712486
{
1247812487
\\"type\\": 3,
1247912488
\\"data\\": {
@@ -13454,7 +13463,7 @@ exports[`record integration tests should not record input values if maskAllInput
1345413463
\\"type\\": 3,
1345513464
\\"data\\": {
1345613465
\\"source\\": 5,
13457-
\\"text\\": \\"\\",
13466+
\\"text\\": \\"**\\",
1345813467
\\"isChecked\\": false,
1345913468
\\"id\\": 62
1346013469
}
@@ -16084,14 +16093,6 @@ exports[`record integration tests should record images inside iframe with blob u
1608416093
\\"isAttachIframe\\": true
1608516094
}
1608616095
},
16087-
{
16088-
\\"type\\": 3,
16089-
\\"data\\": {
16090-
\\"source\\": 4,
16091-
\\"width\\": 1920,
16092-
\\"height\\": 1080
16093-
}
16094-
},
1609516096
{
1609616097
\\"type\\": 3,
1609716098
\\"data\\": {
@@ -17554,7 +17555,7 @@ exports[`record integration tests should record input userTriggered values if us
1755417555
\\"type\\": 3,
1755517556
\\"data\\": {
1755617557
\\"source\\": 5,
17557-
\\"text\\": \\"\\",
17558+
\\"text\\": \\"AA\\",
1755817559
\\"isChecked\\": false,
1755917560
\\"userTriggered\\": false,
1756017561
\\"id\\": 62
@@ -17757,6 +17758,15 @@ exports[`record integration tests should record input values if dynamically adde
1775717758
\\"id\\": 21
1775817759
}
1775917760
},
17761+
{
17762+
\\"type\\": 3,
17763+
\\"data\\": {
17764+
\\"source\\": 3,
17765+
\\"id\\": 21,
17766+
\\"x\\": 24,
17767+
\\"y\\": 0
17768+
}
17769+
},
1776017770
{
1776117771
\\"type\\": 3,
1776217772
\\"data\\": {
@@ -18007,6 +18017,15 @@ exports[`record integration tests should record input values if dynamically adde
1800718017
\\"id\\": 21
1800818018
}
1800918019
},
18020+
{
18021+
\\"type\\": 3,
18022+
\\"data\\": {
18023+
\\"source\\": 3,
18024+
\\"id\\": 21,
18025+
\\"x\\": 27.5,
18026+
\\"y\\": 0
18027+
}
18028+
},
1801018029
{
1801118030
\\"type\\": 3,
1801218031
\\"data\\": {
@@ -18380,7 +18399,7 @@ exports[`record integration tests should record moved shadow DOM 2 1`] = `
1838018399
]"
1838118400
`;
1838218401

18383-
exports[`record integration tests should record mutations in iframes accross pages 1`] = `
18402+
exports[`record integration tests should record mutations in iframes across pages 1`] = `
1838418403
"[
1838518404
{
1838618405
\\"type\\": 0,
@@ -18616,14 +18635,6 @@ exports[`record integration tests should record mutations in iframes accross pag
1861618635
\\"isAttachIframe\\": true
1861718636
}
1861818637
},
18619-
{
18620-
\\"type\\": 3,
18621-
\\"data\\": {
18622-
\\"source\\": 4,
18623-
\\"width\\": 1920,
18624-
\\"height\\": 1080
18625-
}
18626-
},
1862718638
{
1862818639
\\"type\\": 3,
1862918640
\\"data\\": {
@@ -19025,14 +19036,6 @@ exports[`record integration tests should record nested iframes and shadow doms 1
1902519036
\\"isAttachIframe\\": true
1902619037
}
1902719038
},
19028-
{
19029-
\\"type\\": 3,
19030-
\\"data\\": {
19031-
\\"source\\": 4,
19032-
\\"width\\": 1920,
19033-
\\"height\\": 1080
19034-
}
19035-
},
1903619039
{
1903719040
\\"type\\": 3,
1903819041
\\"data\\": {
21 Bytes
Loading

packages/rrweb/test/integration.test.ts

Lines changed: 14 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,6 @@ import {
2121
} from '@sentry-internal/rrweb-types';
2222
import { visitSnapshot, NodeType } from '@sentry-internal/rrweb-snapshot';
2323

24-
/**
25-
* Used to filter scroll events out of snapshots as they are flakey
26-
*/
27-
function isNotScroll(snapshot: eventWithTime) {
28-
return !(
29-
snapshot.type === EventType.IncrementalSnapshot &&
30-
snapshot.data.source === IncrementalSource.Scroll
31-
);
32-
}
33-
3424
describe('record integration tests', function (this: ISuite) {
3525
jest.setTimeout(10_000);
3626

@@ -256,7 +246,7 @@ describe('record integration tests', function (this: ISuite) {
256246
const snapshots = (await page.evaluate(
257247
'window.snapshots',
258248
)) as eventWithTime[];
259-
assertSnapshot(snapshots.filter(isNotScroll));
249+
assertSnapshot(snapshots);
260250
});
261251

262252
it('can record style changes compactly and preserve css var() functions', async () => {
@@ -331,8 +321,7 @@ describe('record integration tests', function (this: ISuite) {
331321
}
332322
});
333323

334-
const snapshots = await page.evaluate('window.snapshots');
335-
assertSnapshot(snapshots);
324+
await assertSnapshot(page);
336325

337326
const lastMutationsLength = await page.evaluate(
338327
'window.lastMutationsLength',
@@ -573,7 +562,6 @@ describe('record integration tests', function (this: ISuite) {
573562

574563
it('should record unblocked elements that are also blocked more generically', async () => {
575564
const page: puppeteer.Page = await browser.newPage();
576-
page.on('console', (msg) => console.log(msg.text()));
577565
await page.goto('about:blank');
578566
const html = getHtml.call(this, 'unblock.html', {
579567
blockSelector: 'div',
@@ -610,7 +598,7 @@ describe('record integration tests', function (this: ISuite) {
610598
const snapshots = (await page.evaluate(
611599
'window.snapshots',
612600
)) as eventWithTime[];
613-
assertSnapshot(snapshots.filter(isNotScroll));
601+
assertSnapshot(snapshots);
614602
});
615603

616604
it('mutations should work when blocked class is unblocked', async () => {
@@ -689,7 +677,7 @@ describe('record integration tests', function (this: ISuite) {
689677
const snapshots = (await page.evaluate(
690678
'window.snapshots',
691679
)) as eventWithTime[];
692-
assertSnapshot(snapshots.filter(isNotScroll));
680+
assertSnapshot(snapshots);
693681
});
694682

695683
it('should record canvas mutations', async () => {
@@ -738,7 +726,7 @@ describe('record integration tests', function (this: ISuite) {
738726
const snapshots = (await page.evaluate(
739727
'window.snapshots',
740728
)) as eventWithTime[];
741-
assertSnapshot(snapshots.filter(isNotScroll));
729+
assertSnapshot(snapshots);
742730
});
743731

744732
it('should record textarea values if dynamically added and maskAllInputs is false', async () => {
@@ -763,7 +751,7 @@ describe('record integration tests', function (this: ISuite) {
763751
const snapshots = (await page.evaluate(
764752
'window.snapshots',
765753
)) as eventWithTime[];
766-
assertSnapshot(snapshots.filter(isNotScroll));
754+
assertSnapshot(snapshots);
767755
});
768756

769757
it('should not record input values if dynamically added, maskAllInputs is false, and mask selector is used', async () => {
@@ -791,7 +779,7 @@ describe('record integration tests', function (this: ISuite) {
791779
const snapshots = (await page.evaluate(
792780
'window.snapshots',
793781
)) as eventWithTime[];
794-
assertSnapshot(snapshots.filter(isNotScroll));
782+
assertSnapshot(snapshots);
795783
});
796784

797785
it('should not record input values if dynamically added and maskAllInputs is true', async () => {
@@ -837,7 +825,7 @@ describe('record integration tests', function (this: ISuite) {
837825
const snapshots = (await page.evaluate(
838826
'window.snapshots',
839827
)) as eventWithTime[];
840-
assertSnapshot(snapshots.filter(isNotScroll));
828+
assertSnapshot(snapshots);
841829
});
842830

843831
it('should record input values if dynamically added, maskAllInputs is true, and unmask selector is used', async () => {
@@ -865,7 +853,7 @@ describe('record integration tests', function (this: ISuite) {
865853
const snapshots = (await page.evaluate(
866854
'window.snapshots',
867855
)) as eventWithTime[];
868-
assertSnapshot(snapshots.filter(isNotScroll));
856+
assertSnapshot(snapshots);
869857
});
870858

871859
it('should record webgl canvas mutations', async () => {
@@ -1050,7 +1038,6 @@ describe('record integration tests', function (this: ISuite) {
10501038

10511039
it('should record images with blob url', async () => {
10521040
const page: puppeteer.Page = await browser.newPage();
1053-
page.on('console', (msg) => console.log(msg.text()));
10541041
await page.goto(`${serverURL}/html`);
10551042
page.setContent(
10561043
getHtml.call(this, 'image-blob-url.html', { inlineImages: true }),
@@ -1067,7 +1054,6 @@ describe('record integration tests', function (this: ISuite) {
10671054

10681055
it('should record images inside iframe with blob url', async () => {
10691056
const page: puppeteer.Page = await browser.newPage();
1070-
page.on('console', (msg) => console.log(msg.text()));
10711057
await page.goto(`${serverURL}/html`);
10721058
await page.setContent(
10731059
getHtml.call(this, 'frame-image-blob-url.html', { inlineImages: true }),
@@ -1084,7 +1070,6 @@ describe('record integration tests', function (this: ISuite) {
10841070

10851071
it('should record images inside iframe with blob url after iframe was reloaded', async () => {
10861072
const page: puppeteer.Page = await browser.newPage();
1087-
page.on('console', (msg) => console.log(msg.text()));
10881073
await page.goto(`${serverURL}/html`);
10891074
await page.setContent(
10901075
getHtml.call(this, 'frame2.html', { inlineImages: true }),
@@ -1310,13 +1295,12 @@ describe('record integration tests', function (this: ISuite) {
13101295
const snapshots = (await page.evaluate(
13111296
'window.snapshots',
13121297
)) as eventWithTime[];
1313-
assertSnapshot(snapshots.filter(isNotScroll));
1298+
assertSnapshot(snapshots);
13141299
});
13151300

1316-
it('should record mutations in iframes accross pages', async () => {
1301+
it('should record mutations in iframes across pages', async () => {
13171302
const page: puppeteer.Page = await browser.newPage();
13181303
await page.goto(`${serverURL}/html`);
1319-
page.on('console', (msg) => console.log(msg.text()));
13201304
await page.setContent(getHtml.call(this, 'frame2.html'));
13211305

13221306
await page.waitForSelector('iframe'); // wait for iframe to get added
@@ -1475,7 +1459,9 @@ describe('record integration tests', function (this: ISuite) {
14751459
}),
14761460
);
14771461

1478-
const snapshots = await page.evaluate('window.snapshots');
1462+
const snapshots = (await page.evaluate(
1463+
'window.snapshots',
1464+
)) as eventWithTime[];
14791465
assertSnapshot(snapshots);
14801466
});
14811467

packages/rrweb/test/record/__snapshots__/cross-origin-iframes.test.ts.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2123,7 +2123,7 @@ exports[`cross origin iframes form.html should map input events correctly 1`] =
21232123
\\"type\\": 3,
21242124
\\"data\\": {
21252125
\\"source\\": 5,
2126-
\\"text\\": \\"\\",
2126+
\\"text\\": \\"AA\\",
21272127
\\"isChecked\\": false,
21282128
\\"id\\": 74
21292129
}

yarn.lock

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5503,15 +5503,10 @@ csso@^4.0.2:
55035503
dependencies:
55045504
css-tree "^1.1.2"
55055505

5506-
cssom@^0.4.4, "cssom@https://registry.npmjs.org/rrweb-cssom/-/rrweb-cssom-0.6.0.tgz":
5506+
cssom@^0.4.4, cssom@^0.5.0, "cssom@https://registry.npmjs.org/rrweb-cssom/-/rrweb-cssom-0.6.0.tgz":
55075507
version "0.6.0"
55085508
resolved "https://registry.npmjs.org/rrweb-cssom/-/rrweb-cssom-0.6.0.tgz#ed298055b97cbddcdeb278f904857629dec5e0e1"
55095509

5510-
cssom@^0.5.0:
5511-
version "0.5.0"
5512-
resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.5.0.tgz#d254fa92cd8b6fbd83811b9fbaed34663cc17c36"
5513-
integrity sha512-iKuQcq+NdHqlAcwUY0o/HL69XQrUaQdMjmStJ8JFmUaiiQErlhrmuigkg/CU4E2J0IyUKUrMAgl36TvN67MqTw==
5514-
55155510
cssom@~0.3.6:
55165511
version "0.3.8"
55175512
resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.3.8.tgz#9f1276f5b2b463f2114d3f2c75250af8c1a36f4a"

0 commit comments

Comments
 (0)