Skip to content

chore(rrweb): move the fork onto upstream rrweb 2.2.0 - #117

Merged
krassx merged 2 commits into
mainfrom
chore/rrweb-2.2.0
Oct 26, 2026
Merged

krassx merged 2 commits into
mainfrom
chore/rrweb-2.2.0

Conversation

@krassx

@krassx krassx commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Moves @bugsee/rrweb onto upstream rrweb 2.2.0 (published 2026-10-24): rrweb / @rrweb/types to ^2.2.0 and @bugsee/rrweb-record re-pinned to the rebuilt record-only bundle of the Bugsee-hardened fork. The change is packages/rrweb/package.json, pnpm-lock.yaml and a docs/PROGRESS.md entry. No SDK source changes.

What changed upstream (2.1.7 to 2.2.0) and how it affects us

  • Recorder leak fixes (#1971, #1958, #1973, #1928): mutation buffers, same-origin iframe observers, shadow-DOM observers and the WebKit helper iframe are now released on removal/unload, and rrweb-snapshot's mirror releases removed shadow trees. They are re-created when a host or iframe comes back, which is the one thing that matters for masking (see below).
  • New record.addAnnotation(), EventType.Annotation and annotationData in @rrweb/types. It is in the bundle but deliberately NOT exposed from @bugsee/rrweb: no replay design here needs it, and annotation text is caller-supplied. Available if wanted later.
  • Player-only changes (annotation timeline in rrweb-player) and browser-client changes are not part of the record-only bundle.
  • No breaking changes.
  • Public surface: the .d.ts is unchanged, but @bugsee/rrweb re-exports EventType and eventWithTime from @rrweb/types, which now include Annotation = 8 / annotationEvent, and the exported record carries an untyped .addAnnotation at runtime.

Fork merge (bugsee/rrweb)

  • bugsee-port-2.2.0 merges tag rrweb@2.2.0 (e051ddbf) into the true bugsee-port tip (origin 08a56f93; the local ref 52f98a24 was just behind it): merge 4a81d36d, no textual conflicts. Both sides changed rrweb-snapshot/src/utils.ts and rrweb/src/record/{index,mutation,observer}.ts; they merged cleanly and I reviewed the overlap by hand. Tip cdb77793.
  • Masking review of the 2.1.7..2.2.0 diff over record/snapshot paths: every masking option (maskAllText, unmaskText*, unblockSelector, unmaskInputSelector, maskAttributeFn, maskInputOptions) still reaches the shadow-root bypassOptions, the iframe observe(doc) closure and the mutation buffers, and the single resolveInputValue path is unchanged. Nothing new emits page content except the annotation event (caller text only).
  • New fork test packages/rrweb/test/record/masking-observer-lifecycle.test.ts (9 tests): masking on text added/edited/typed in a shadow root re-attached after its host was removed, a removed-then-restored subtree, an input value attribute in a re-observed shadow root, a same-origin iframe attached again by a second full snapshot, selector unmask still working on the re-observed path, and that addAnnotation emits only the caller's payload. Tests assert the masked form is present (non-vacuous). Scope: shadow roots re-attached by host reinsertion, a restored subtree, and an iframe attached again by a second full snapshot; NOT an iframe document re-observed after it unloads, nor maskAttributeFn / blockSelector / unblockSelector / ignoreSelector on re-observed observers (follow-up issues filed). Mutator loop: 6 mutations (shadow maskAllText off, observe() maskAllText off, input observer bypassing resolveInputValue, text mutation never masked, shadow maskInputOptions dropped, shadow unmaskTextSelector dropped); 5 were caught immediately, the maskInputOptions one survived until I added the value-attribute test, then was caught. Source restored from saved copies and verified identical.
  • bugsee-dist-2.2.0 5643229f (on top of bugsee-dist ad172467): built like the 2.1.7 bundle, vite dist/rrweb-record.js via vite.config.entries.js, then esbuild --bundle --minify --format=esm. I tried the recipe on the 2.1.7 tree first: it does not reproduce the pinned 2.1.7 bundle exactly; it differs by more than identifier names (module order, some helper/enum output, a ~850 B tslib license comment).
  • Pushed only the two new branches; bugsee-port, bugsee-dist and main untouched, no force pushes.

Size

raw gzip
record-only bundle 2.1.7 (ad172467) 184,815 B 58,604 B
record-only bundle 2.2.0 (5643229f) 185,496 B 58,698 B (+94 B)
@bugsee/rrweb dist/index.js before 249,156 B 65,016 B
@bugsee/rrweb dist/index.js after 250,375 B 65,199 B (+183 B, gzip -9)

Evidence

  • pnpm ci:local passes (lint, typecheck, cycles, packaging guard, per-package coverage gate, harness unit tests). The e2e job was not run locally.
  • @bugsee/rrweb, @bugsee/replay (143, including masking integration + fuzz), @bugsee/replay-canvas, @bugsee/browser (1316), @bugsee/bugsee (294) all green; replay.e2e.ts, blackout.e2e.ts, browser.e2e.ts green on the new bundle.
  • Real-browser smoke (Playwright Chromium, default fail-closed masking from resolveReplayMaskingOptions({}), the real new bundle): typed text, password, cc-number, email, textarea, alt/title/data-* attributes, a re-attached shadow root (text + typed input), a same-origin iframe (text edit, typed input, navigation to a new document, second full snapshot), and dynamically added nodes. 22 distinct secrets, 0 in the events; controls (.bugsee-unmask text and a .bugsee-unmask input) are present, and the same page with masking off leaks, so the harness can fail. The script is not committed.
  • Fork suites: the full rrweb and rrweb-snapshot suites have the same set of failing tests on 2.2.0 as on the 2.1.7 fork (31 vs 31 plus one intermittent test, record.test.ts "can checkout full snapshot by count", which flakes on both; they come from running the old puppeteer against modern Chrome and from integration.test.ts "dynamically added and maskAllInputs", which flakes on both: it differs only in event ORDER and values are masked either way). tsc and eslint clean.

minimumReleaseAge

Not needed: pnpm install resolved rrweb 2.2.0 and siblings without a refusal, so no minimumReleaseAgeExclude entry was added.

🤖 Generated with Claude Code

Fork bugsee-port-2.2.0 (rrweb-io/rrweb 2.2.0 merged, no conflicts, hardening intact) with the
record-only bundle rebuilt on bugsee-dist-2.2.0 (5643229f). rrweb/@rrweb/types ranges bumped to ^2.2.0.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
@claude

claude Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Claude finished @krassx's task in 38s —— View job


Review of PR #117: move @bugsee/rrweb onto upstream rrweb 2.2.0

I found no real issues in the diff. I reviewed the diff only. I did not run tests, the build, or pnpm install. The CI run was still in progress when I checked, so its result is not covered here.

What I checked

  • Lockfile consistency: pnpm-lock.yaml is consistent with packages/rrweb/package.json. The rrweb, @rrweb/types, @rrweb/utils, rrdom and rrweb-snapshot entries all move to 2.2.0 together, and the @bugsee/rrweb-record git pin matches the new SHA (5643229f…). No 2.1.7 rrweb entries remain. The only 2.1.7 hits are brace-expansion.
  • Public surface: packages/rrweb/src/index.ts re-exports only record and the types EventType, eventWithTime and listenerHandler. addAnnotation is not exposed, as the PR description says.
  • Type-union change: 2.2.0 adds EventType.Annotation to the eventWithTime union. I grepped packages/replay and packages/replay-canvas for exhaustive switches or never checks on event type and found none, so the wider union should not break their typecheck.
  • Packaging: @bugsee/rrweb-record is bundled in through noExternal in tsup.config.ts, so customers do not pick up the git dependency. The new bundle adds about +183 B gzip to dist/index.js, as the PR table says.

Notes, none blocking

  • P3, floor on type-only dependencies: rrweb and @rrweb/types stay as runtime dependencies (packages/rrweb/package.json:30-32), but only types are imported from them. Raising the floor to ^2.2.0 makes every consumer install 2.2.0 just for types. This was already true on 2.1.7, so it is not a regression. Moving them to peerDependencies or devDependencies would be a separate cleanup.
  • P3, e2e not run locally: the PR says the e2e job was not run locally. The new @bugsee/rrweb-record bundle is the only runtime-affecting change, so wait for the CI e2e job to go green before merging.
  • P3, smoke script not committed: the real-browser masking smoke script behind the "22 secrets, 0 leaked" claim is not in the repo. The new fork test, masking-observer-lifecycle.test.ts, lives in the bugsee/rrweb fork. Nothing in this repo would catch a masking regression on the next rrweb bump, so you may want to add a small integration test here for re-attached shadow roots.

Summary

  1. Overall risk: Low. It is a dependency bump with no SDK source changes, and the masking-sensitive paths are covered by the fork's new tests and the PR's smoke run.
  2. Merge recommendation: Approve once CI is green, including the e2e job. I cannot approve PRs myself.
  3. Most important item: confirm the e2e job passes on the new bundle.
  4. Positives:
    • The lockfile, pin and docs entry line up.
    • The PR records the masking review of the 2.1.7 to 2.2.0 diff and the mutator-loop results.
    • Annotations are left unexposed on purpose.
    • The docs/PROGRESS.md entry records the changes.
      · branch chore/rrweb-2.2.0

@coderabbitai

coderabbitai Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 53f39e17-80de-4b99-80a5-3d2efd785ac5
Commits

Reviewing files that changed from the base of the PR and between 463836e and 2bfc85d.

Files selected for processing: 1
  • docs/PROGRESS.md
Files skipped from review as they are similar to previous changes: 1
  • docs/PROGRESS.md

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.

📝 Summary

Summary by CodeRabbit

  • Maintenance

    • Updated the replay SDK and its associated packages to version 2.2.0.
    • Refreshed the replay recording integration to keep it aligned with the updated SDK.
  • Documentation

    • Added a progress note describing the SDK update, observer-lifecycle validation and coverage gaps, and related package changes. It also records that the public type declarations remain unchanged.

The @rrweb/types and rrweb dependency ranges move from ^2.1.7 to ^2.2.0. The @bugsee/rrweb-record Git dependency moves to a new commit. The progress log documents the update, observer lifecycle test coverage and gaps, and runtime exports. It also states that the declarations are unchanged and the SDK does not call addAnnotation.

Possibly related issues

Priority: Low

Change: Other

Merge Risk: Minimal · up to 2bfc8

No actionable issue is identified; the update is mergeable after normal checks.

Architecture risk: Low · up to 46383

The change affects 2 systems.

Changed systems: docs, packages/rrweb

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — docs (service) was modified; 1 changed file maps to changed impact.
  • observed — packages/rrweb (library) was modified; 1 changed file maps to changed impact.

Before / after behavior

  • observed — Modified behavior in docs/PROGRESS.md: Added the 2026-10-26 entry documenting the rrweb 2.2.0 fork and bundle updates, package version pins, and a test confirming masking options remain applied after shadow-root and same-origin iframe observers are reattached. The entry also states that record.addAnnotation() remains unexposed.
  • observed — Modified behavior in packages/rrweb/package.json: The @rrweb/types and rrweb dependency ranges change from ^2.1.7 to ^2.2.0.
  • observed — Modified behavior in packages/rrweb/package.json: The @bugsee/rrweb-record Git dependency changes from commit ad172467b79223adc73ee0516bee64d0935f4ab9 to 5643229f7b9a1cb241af90f55331d39fcaa3db54.
Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title clearly identifies the main change: moving the rrweb fork to upstream rrweb 2.2.0.
Description check Passed The description directly explains the dependency updates, fork rebuild, test coverage, masking review, and validation results.
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.)

Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

…ope, public surface, bundle reproducibility)

🤖 Generated with [Claude Code](https://claude.com/claude-code)
@claude

claude Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Claude finished @krassx's task in 23s —— View job


Review of PR #117 (re-review after the docs-correction commit 2bfc85dd)

I found no new real issues in the diff. I read the diff, the lockfile changes and packages/rrweb/src/index.ts. I did not run tests, builds or pnpm install. CI was still in_progress when I checked, so the e2e result is not covered here.

Since my earlier review

  • The only new commit is 2bfc85dd, a docs/PROGRESS.md rewrite. It does not touch code or dependencies, so my earlier conclusions still hold.
  • The lockfile still matches packages/rrweb/package.json. rrweb, @rrweb/types, @rrweb/utils, rrdom and rrweb-snapshot all move to 2.2.0 together. The @bugsee/rrweb-record pin 5643229f… agrees between the manifest and the lockfile, and its peer resolution is (@rrweb/types@2.2.0)(rrweb@2.2.0).
  • The public surface is unchanged. packages/rrweb/src/index.ts exports only record plus the types EventType, eventWithTime and listenerHandler. @bugsee/rrweb-record is still inlined by tsup (noExternal), so customers don't pick up the git dependency.

Notes (P3, none blocking)

  • PR description contradicts the docs entry. The description says the fork merge had "no conflicts, all hardening files untouched by upstream". The corrected docs/PROGRESS.md entry says both sides changed rrweb-snapshot/src/utils.ts and rrweb/src/record/{index,mutation,observer}.ts, and that these merged cleanly and were reviewed by hand. The docs entry is the more careful claim, so I'd edit the description to match. Auto-merging in the exact files that hold the masking logic is why the fork's masking tests matter here.
  • Documented gaps in the masking test. The docs entry says the new fork test does not cover an iframe document re-observed after it unloads, or maskAttributeFn / blockSelector / unblockSelector / ignoreSelector on re-observed observers. Upstream's 2.2.0 leak fixes release and re-create exactly those observers. maskAttributeFn is Bugsee-specific. A follow-up test in the fork would close the gap. The real-browser smoke run covers navigation and the attribute cases only once, and that script is not committed.
  • Bundle not reproducible. The docs entry now says a fresh build of the 2.1.7 tip is not identical to the pinned 2.1.7 bundle beyond identifier names. This conflicts with the PR description's "same code modulo minifier identifier names and one license comment". I'd align the two. It also means the 2.2.0 bundle's provenance rests on the fork SHA plus the lockfile integrity hash rather than a reproducible build.
  • Wait for CI. The e2e job (replay.e2e.ts, blackout.e2e.ts, browser.e2e.ts) exercises the new runtime bundle and was not run locally. Hold the merge until it is green.
  • Carried over from my earlier review. rrweb and @rrweb/types are runtime dependencies although only types are imported, so the floor bump forces 2.2.0 on consumers. This was already true on 2.1.7.

Summary

  1. Overall risk: Low. It is a dependency bump with no SDK source changes. The masking-sensitive paths have the fork's new tests and the PR's smoke run behind them.
  2. Merge recommendation: Approve once the CI run, including e2e, is green. I can't approve PRs myself.
  3. Most important item: confirm the e2e job passes on the new bundle. Then reconcile the PR description with the docs entry on the merge-overlap and bundle-reproducibility claims.
  4. Positives:
    • The pin, lockfile and docs line up.
    • The docs correction is honest about the test's limits and the unexposed addAnnotation.
    • Masking was reviewed on the upstream diff.
    • The mutator loop found and fixed a surviving mutation.
      · branch chore/rrweb-2.2.0

@krassx

krassx commented Oct 26, 2026

Copy link
Copy Markdown
Contributor Author

Reply to the re-review: the PR description was corrected after that run read it. It now says there were no textual conflicts but both sides changed rrweb-snapshot/src/utils.ts and record/{index,mutation,observer}.ts (merged cleanly, reviewed by hand), that the 2.1.7 recipe does not reproduce the pinned bundle exactly (more than identifier names), and it states the public-surface change (Annotation = 8 re-exported types, untyped runtime record.addAnnotation) and the test scope. The e2e job is green on the new bundle. The test-coverage gaps are tracked in #119, the real-browser test in #120, and the blocked same-origin iframe leak (pre-existing, also in 2.1.7) in #118.

🤖 Generated with Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant