Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Stopping recording causes all insertRule hooks added after record start to drop #1518

Open
1 task done
eugene-chang-fs opened this issue Jun 21, 2024 · 0 comments
Open
1 task done
Labels
bug Something isn't working

Comments

@eugene-chang-fs
Copy link

Preflight Checklist

  • I have searched the issue tracker for a bug report that matches the one I want to file, without success.

What package is this bug report for?

rrweb

Version

v1.1.3

Expected Behavior

Sentry/rrweb should not drop hooks on the prototypical chain (shown in demo under output).

See result without rrweb: https://imgur.com/C0veqB0

Actual Behavior

Sentry/rrweb does drop hooks installed.

See result with rrweb extension: https://imgur.com/a/DGIoUSv

Steps to Reproduce

As far as I'm aware, this happens to all versions.

Any hooks added to insertRule are dropped once rrweb stops recording.

  1. Start capturing
  2. Add a hook to CSSStyleSheet.prototype.insertRule
  3. Stop capturing
  4. Observe that hook added by step 2 is no longer in place

Expected/actual behaviors are two videos of a demo page (source: https://jsfiddle.net/pmd5L8v7/). Once hooked, adding a rule to change the color of the text snippet at the top should result in an output line, indicating that the hook worked. But in the result with rrweb, this behavior is absent, indicating that the hook was dropped.

Testcase Gist URL

No response

Additional Information

This was originally filed with sentry @ getsentry/sentry-javascript#11837 but was suggested to post the issue here.

@eugene-chang-fs eugene-chang-fs added the bug Something isn't working label Jun 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant