GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||
GeezerVison is showing github.com — fix(snapshot): Clear leftover nodes when `document.open()` is skipped by sentry-junior[bot] · Pull Request #350 · getsentry/rrweb Conversation
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
The previous doctype-placement change assumed a snapshot with the doctype after <html>, but a crashing replay has a normal [doctype, html] snapshot. Both production HierarchyRequestError messages reproduce instead when document.open() is a no-op because the iframe document's parser was aborted: the previous rebuild stays in place and the new doctype can't be appended. Remove any leftover children after open() and revert the doctype-placement change. Co-Authored-By: George Gritsouk <[email protected]>
The existing unit test stubs document.open(). This adds puppeteer tests that abort the iframe document's parser the way browsers do, with window.stop() and with a link click that never commits a new document (a 204), check that open() is now a no-op, and then rebuild. Both fail with "Can't insert a doctype after the root element" without the fix. Also drop the changeset, since sentry-v2 no longer uses changesets. Co-Authored-By: George Gritsouk <[email protected]>
document.open() is skipped
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Address review feedback: replace the parameterized abort triggers with two explicit test cases that share setup helpers, drop the leftover headless comment, and say in rebuild.ts that open() doesn't throw when it skips clearing the document.
|
@cursor review |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 21ee16c. Configure here.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
LGTM, I will handle the compat mode leftover in a separate PR
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| // once the document's parser was aborted (e.g. by window.stop()), open() | ||
| // returns without throwing and without clearing the previous rebuild, | ||
| // which would make the appends below throw a HierarchyRequestError | ||
| while (doc.firstChild) { |
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
nit: This fixes the crash, but leaves out some stale state like compatMode.
It's a very rare case, I had an agent try it in Chromium, after window.stop() a quirks snapshot stays CSS1Compat, and a standards one stays BackCompat if the previous rebuild was quirks.
I can PR that separately once this one merges, probably will try to replace the entire iframe.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
…130930) Bumps the Sentry JavaScript SDK from 11.7.0 to [11.12.0](https://github.com/getsentry/sentry-javascript/releases/tag/11.12.0), mainly to pick up rrweb [2.46.0](https://github.com/getsentry/rrweb/releases/tag/2.46.0) (getsentry/sentry-javascript#26241). rrweb 2.46.0 fixes: - Clear leftover nodes when `document.open()` is skipped (getsentry/rrweb#350) - Don't record the default value of cleared inputs (getsentry/rrweb#349) - Keep adopted stylesheets on seek when their first host was removed (getsentry/rrweb#352) - Don't throw when tearing down a locked `adoptedStyleSheets` patch (getsentry/rrweb#351) Changes: - `@sentry/browser`, `@sentry/core`, `@sentry/node`, `@sentry/react`: 11.7.0 → 11.12.0 across `static/app`, `static/gsApp`, `static/gsAdmin`, `static/packages/scraps`, and `tests/js`. - `@sentry/rrweb`, `@sentry/rrweb-player`, `@sentry/rrweb-snapshot`: 2.45.0 → 2.46.0, so the replay player uses the same rrweb as the SDK. - `@sentry/rrweb-types`: 2.44.0 → 2.46.0. This drops the duplicate `@sentry/[email protected]` / `@sentry/[email protected]` entries from the lockfile. <!-- junior-request-attribution:start --> via **George Gritsouk**. <!-- junior-request-attribution:end --> <!-- junior-session-footer:start --> <!-- junior-conversation-id:slack%3AD0AR76A9F5G%3A1794502210.473359 --> Closes REPLAY-1029 Closes REPLAY-1019 -- [View Session](https://junior-prod.sentry.dev/conversations/slack%3AD0AR76A9F5G%3A1794502210.473359) [[Sentry]](https://sentry.sentry.io/explore/conversations/slack%3AD0AR76A9F5G%3A1794502210.473359/?project=4510944073809921) <!-- junior-session-footer:end --> Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com> Co-authored-by: George Gritsouk <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.