Skip to content

Commit f798f41

Browse files
authored
chore: renable bundled size checking now main and PR will be on pnpm (#120)
for https://app.graphite.com/github/pr/PostHog/posthog-rrweb/107/chore-switch-from-yarn-to-pnpm i had to disable bundled size checking because main was on yarn and PR was on PNPM now that that is merged, we can re-enable bundled size checking
1 parent 316c660 commit f798f41

File tree

2 files changed

+23
-17
lines changed

2 files changed

+23
-17
lines changed

.github/workflows/ci-cd.yml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,13 @@ jobs:
4040
- name: Run tests
4141
run: PUPPETEER_HEADLESS=true xvfb-run --server-args="-screen 0 1920x1080x24" pnpm test
4242

43-
# TODO: Re-enable after pnpm migration is merged to main
44-
# - name: Check bundle sizes
45-
# uses: preactjs/compressed-size-action@v2
46-
# with:
47-
# install-script: "pnpm install --frozen-lockfile"
48-
# build-script: "build:all"
49-
# compression: "none"
50-
# pattern: "**/dist/*.{js,cjs,mjs,css}"
43+
- name: Check bundle sizes
44+
uses: preactjs/compressed-size-action@v2
45+
with:
46+
install-script: "pnpm install --frozen-lockfile"
47+
build-script: "build:all"
48+
compression: "none"
49+
pattern: "**/dist/*.{js,cjs,mjs,css}"
5150

5251
- name: Upload diff images to GitHub
5352
uses: actions/upload-artifact@v4

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

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,21 +46,28 @@ type ExtraOptions = {
4646
async function injectRecordScript(
4747
frame: puppeteer.Frame,
4848
options?: ExtraOptions,
49+
retryCount = 0,
4950
) {
51+
const MAX_RETRIES = 5;
5052
try {
5153
await frame.addScriptTag({
5254
path: path.resolve(__dirname, '../../dist/rrweb.umd.cjs'),
5355
});
5456
} catch (e) {
55-
// we get this error: `Protocol error (DOM.resolveNode): Node with given id does not belong to the document`
56-
// then the page wasn't loaded yet and we try again
57-
if (
58-
!e.message.includes('DOM.resolveNode') ||
59-
!e.message.includes('DOM.describeNode')
60-
)
61-
throw e;
62-
await injectRecordScript(frame, options);
63-
return;
57+
const retryableErrors = [
58+
'DOM.resolveNode',
59+
'DOM.describeNode',
60+
'Execution context was destroyed',
61+
];
62+
const isRetryable = retryableErrors.some((error) =>
63+
e.message.includes(error),
64+
);
65+
if (isRetryable && retryCount < MAX_RETRIES) {
66+
await new Promise((resolve) => setTimeout(resolve, 50));
67+
await injectRecordScript(frame, options, retryCount + 1);
68+
return;
69+
}
70+
throw e;
6471
}
6572
options = options || {};
6673
await frame.evaluate((options) => {

0 commit comments

Comments
 (0)