Skip to content

feat(v8/replay): Opt-in options for unmask and unblock #11049

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

Merged
merged 3 commits into from
Mar 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions MIGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -827,6 +827,22 @@ The SDK no longer filters out health check transactions by default. Instead, the
by the Sentry backend by default. You can disable dropping them in your Sentry project settings. If you still want to
drop specific transactions within the SDK you can either use the `ignoreTransactions` SDK option.

#### Change of Replay default options (`unblock` and `unmask`)

The Replay options `unblock` and `unmask` now have `[]` as default value. This means that if you want to use these
options, you have to explicitly set them like this:

```js
Sentry.init({
integrations: [
Sentry.replayIntegration({
unblock: ['.sentry-unblock, [data-sentry-unblock]'],
unmask: ['.sentry-unmask, [data-sentry-unmask]'],
}),
],
});
```

#### Angular Tracing Decorator renaming

The usage of `TraceClassDecorator` and the `TraceMethodDecorator` already implies that those are decorators. The word
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ window.Replay = Sentry.replayIntegration({
minReplayDuration: 0,
useCompression: false,
blockAllMedia: false,
unmask: ['.sentry-unmask, [data-sentry-unmask]'],
});

Sentry.init({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ window.Replay = Sentry.replayIntegration({
useCompression: false,
blockAllMedia: false,
block: ['link[rel="icon"]', 'video', '.nested-hide'],
unmask: ['.sentry-unmask, [data-sentry-unmask]'],
});

Sentry.init({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
<body>
<button aria-label="Click me" onclick="console.log('Test log')">Click me</button>
<div>This should be masked by default</div>
<div data-sentry-unmask>This should be unmasked due to data attribute</div>
<div data-sentry-unmask>With default settings, this should also be masked (even with data attribute)</div>
<input placeholder="Placeholder should be masked" />
<input data-sentry-unmask placeholder="Placeholder can be unmasked" />
<input data-sentry-unmask placeholder="Placeholder can be unmasked - but not with default settings" />
<div title="Title should be masked">Title should be masked</div>
<svg style="width:200px;height:200px" viewBox="0 0 80 80"><path d=""/><area /><rect /></svg>
<svg style="width:200px;height:200px" viewBox="0 0 80 80" data-sentry-unblock><path d=""/><area /><rect /></svg>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
"childNodes": [
{
"type": 3,
"textContent": "This should be unmasked due to data attribute",
"textContent": "**** ******* ********* **** ****** **** ** ****** ***** **** **** **********",
"id": 17
}
],
Expand Down Expand Up @@ -136,7 +136,7 @@
"tagName": "input",
"attributes": {
"data-sentry-unmask": "",
"placeholder": "Placeholder can be unmasked"
"placeholder": "*********** *** ** ******** * *** *** **** ******* ********"
},
"childNodes": [],
"id": 21
Expand Down Expand Up @@ -186,45 +186,17 @@
"type": 2,
"tagName": "svg",
"attributes": {
"style": "width:200px;height:200px",
"viewBox": "0 0 80 80",
"data-sentry-unblock": ""
"rr_width": "[200-250]px",
"rr_height": "[200-250]px"
},
"childNodes": [
{
"type": 2,
"tagName": "path",
"attributes": {
"d": ""
},
"childNodes": [],
"isSVG": true,
"id": 29
},
{
"type": 2,
"tagName": "area",
"attributes": {},
"childNodes": [],
"isSVG": true,
"id": 30
},
{
"type": 2,
"tagName": "rect",
"attributes": {},
"childNodes": [],
"isSVG": true,
"id": 31
}
],
"childNodes": [],
"isSVG": true,
"id": 28
},
{
"type": 3,
"textContent": "\n ",
"id": 32
"id": 29
},
{
"type": 2,
Expand All @@ -234,28 +206,27 @@
"rr_height": "[100-150]px"
},
"childNodes": [],
"id": 33
"id": 30
},
{
"type": 3,
"textContent": "\n ",
"id": 34
"id": 31
},
{
"type": 2,
"tagName": "img",
"attributes": {
"data-sentry-unblock": "",
"style": "width:100px;height:100px",
"src": "file:///none.png"
"rr_width": "[100-150]px",
"rr_height": "[100-150]px"
},
"childNodes": [],
"id": 35
"id": 32
},
{
"type": 3,
"textContent": "\n ",
"id": 36
"id": 33
},
{
"type": 2,
Expand All @@ -265,17 +236,17 @@
"rr_height": "[0-50]px"
},
"childNodes": [],
"id": 37
"id": 34
},
{
"type": 3,
"textContent": "\n ",
"id": 38
"id": 35
},
{
"type": 3,
"textContent": "\n\n",
"id": 39
"id": 36
}
],
"id": 8
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
"childNodes": [
{
"type": 3,
"textContent": "This should be unmasked due to data attribute",
"textContent": "**** ******* ********* **** ****** **** ** ****** ***** **** **** **********",
"id": 17
}
],
Expand All @@ -121,7 +121,7 @@
"type": 2,
"tagName": "input",
"attributes": {
"placeholder": "*********** ****** ** ******"
"placeholder": "*********** *** ** ******** * *** *** **** ******* ********"
},
"childNodes": [],
"id": 19
Expand Down Expand Up @@ -226,12 +226,12 @@
{
"type": 3,
"textContent": "\n ",
"id": 33
"id": 34
},
{
"type": 3,
"textContent": "\n\n",
"id": 34
"id": 35
}
],
"id": 8
Expand All @@ -248,4 +248,4 @@
}
},
"timestamp": [timestamp]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
"childNodes": [
{
"type": 3,
"textContent": "This should be unmasked due to data attribute",
"textContent": "**** ******* ********* **** ****** **** ** ****** ***** **** **** **********",
"id": 17
}
],
Expand Down Expand Up @@ -136,7 +136,7 @@
"tagName": "input",
"attributes": {
"data-sentry-unmask": "",
"placeholder": "Placeholder can be unmasked"
"placeholder": "*********** *** ** ******** * *** *** **** ******* ********"
},
"childNodes": [],
"id": 21
Expand Down Expand Up @@ -186,45 +186,17 @@
"type": 2,
"tagName": "svg",
"attributes": {
"style": "width:200px;height:200px",
"viewBox": "0 0 80 80",
"data-sentry-unblock": ""
"rr_width": "[200-250]px",
"rr_height": "[200-250]px"
},
"childNodes": [
{
"type": 2,
"tagName": "path",
"attributes": {
"d": ""
},
"childNodes": [],
"isSVG": true,
"id": 29
},
{
"type": 2,
"tagName": "area",
"attributes": {},
"childNodes": [],
"isSVG": true,
"id": 30
},
{
"type": 2,
"tagName": "rect",
"attributes": {},
"childNodes": [],
"isSVG": true,
"id": 31
}
],
"childNodes": [],
"isSVG": true,
"id": 28
},
{
"type": 3,
"textContent": "\n ",
"id": 32
"id": 29
},
{
"type": 2,
Expand All @@ -234,28 +206,27 @@
"rr_height": "[100-150]px"
},
"childNodes": [],
"id": 33
"id": 30
},
{
"type": 3,
"textContent": "\n ",
"id": 34
"id": 31
},
{
"type": 2,
"tagName": "img",
"attributes": {
"data-sentry-unblock": "",
"style": "width:100px;height:100px",
"src": "file:///none.png"
"rr_width": "[100-150]px",
"rr_height": "[100-150]px"
},
"childNodes": [],
"id": 35
"id": 32
},
{
"type": 3,
"textContent": "\n ",
"id": 36
"id": 33
},
{
"type": 2,
Expand All @@ -265,17 +236,17 @@
"rr_height": "[0-50]px"
},
"childNodes": [],
"id": 37
"id": 34
},
{
"type": 3,
"textContent": "\n ",
"id": 38
"id": 35
},
{
"type": 3,
"textContent": "\n\n",
"id": 39
"id": 36
}
],
"id": 8
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
"childNodes": [
{
"type": 3,
"textContent": "This should be unmasked due to data attribute",
"textContent": "**** ******* ********* **** ****** **** ** ****** ***** **** **** **********",
"id": 17
}
],
Expand Down Expand Up @@ -136,7 +136,7 @@
"tagName": "input",
"attributes": {
"data-sentry-unmask": "",
"placeholder": "Placeholder can be unmasked"
"placeholder": "*********** *** ** ******** * *** *** **** ******* ********"
},
"childNodes": [],
"id": 21
Expand Down Expand Up @@ -292,4 +292,4 @@
}
},
"timestamp": [timestamp]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ window.Replay = Sentry.replayIntegration({
minReplayDuration: 0,
useCompression: false,
maskAllInputs: false,
unmask: ['.sentry-unmask, [data-sentry-unmask]'],
});

Sentry.init({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ window.Replay = Sentry.replayIntegration({
minReplayDuration: 0,
useCompression: false,
maskAllInputs: true,
unmask: ['.sentry-unmask, [data-sentry-unmask]'],
});

Sentry.init({
Expand Down
2 changes: 1 addition & 1 deletion packages/replay/MIGRATION.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# End of Replay Beta

Sentry Replay is now out of Beta. This means that the usual stability guarantees apply.
> For further migration changes please refer to the [general SDK migration notes](../../MIGRATION.md).

Because of experimentation and rapid iteration, during the Beta period some bugs and problems came up which have since
been fixed/improved. We **strongly** recommend anyone using Replay in a version before 7.39.0 to update to 7.39.0 or
Expand Down
Loading