-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
feat(replay): Deprecate privacy options in favor of a new API, remove some recording options #6645
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
Conversation
368e29e
to
be11ca5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thoughts on this API?
I'm going to create a branch on https://github.com/getsentry/rrweb where I'll push up changes to the rrweb library. |
size-limit report 📦
|
Two thoughts on this:
I have to admit for me this (even with the options we have now) can be a bit confusing, it is rather un-symmetrical. Instead of adding two more options like this, IMHO I'd rather prefer it to provide a better, more unified API for this. I am not entirely sure how that would look like, but for example something like this:
something along this line would be a more consistent & easy to understand API from my POV. But obviously would also need adjustments to rrweb, as this is not really possible to do with what exists there now. IMHO the best way to implement such a thing on rrweb side is to allow to pass regex to all options, and then build a regex on our side for the array options (otherwise, it can be hard to exclude multiple selectors, because So, I guess if you feel strongly that adding these options for now is important, I'm OK with that, but IMHO it is really more of a bandaid and might come back to bite us later if we have a loooong list of options that we can't get rid of anymore.
|
Thanks, you bring up some good points, replies below:
It's possible (although we previously had some trouble getting it to work when we were using the more broad As an aside, I would also like to make
I agree with this. Also having the
This is not unlike what we are doing with I do agree that "block" and "ignore" are not very clear. Renaming
It's not the most important, but I think it's important to give users good control over privacy configuration. Let me work on an API proposal with #6641 in mind as well.
I actually built this on v2 because I was working off their master branch 🤦. Agree about upgrading to v2, but don't think we should wait to make these changes. Although we should agree on an API before proceeding. |
@mydea thoughts on this? I will need to patch rrweb a bit more to add |
8c1eaa2
to
23df92e
Compare
packages/replay/src/integration.ts
Outdated
]; | ||
|
||
// @deprecated | ||
if (blockClass) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: support regex
23df92e
to
f5ac26d
Compare
inlineImages: false, | ||
// collect fonts, but be aware that `sentry.io` needs to be an allowed | ||
// origin for playback | ||
collectFonts: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We may get some CORS errors on playback, but it should be fine as it will fallback to system fonts.
maskInputSelector
and unmaskTextSelector
}), | ||
|
||
// Our defaults | ||
slimDOMOptions: 'all', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to be clear (we should put this in the changelog), this means passing through "random" rrweb option is not possible anymore in this release!
/** | ||
* Ignore input events for elements that match the CSS selectors in the list. | ||
*/ | ||
ignore?: string[]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we go with ignoreEvents
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mydea hmm my worry is that people will confuse it for DOM events e.g. clicks?
/** | ||
* A callback function to customize how your text is masked. | ||
*/ | ||
maskFn?: Pick<RecordingOptions, 'maskTextFn'>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just thinking, do we need to expose this? Or is it OK to just not allow to configure this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm thinking we should keep it since we are being so aggressive about privacy first
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good to me! 🚀
This was unintentionally removed in #6645 - it is still deprecated and will be removed at a later date.
This was unintentionally removed in #6645 - it is still deprecated and will be removed at a later date. Co-authored-by: Lukas Stracke <[email protected]>
maskTextSelector
,maskTextClass
,blockClass
,blockSelector
,ignoreClass
in favor of new API:mask
,block
,ignore
which accepts an array of CSS selectors.unmask
,unblock
. This can be used in conjunction withmaskAllText
,blockAllMedia
to have privacy by default and selectively unmask elements.Note: We'll need to upgrade
sentry-docs
as well.Closes #6559, #6582