-
-
Notifications
You must be signed in to change notification settings - Fork 434
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
[SR] Add custom redaction options #3689
Conversation
*/ | ||
private boolean redactAllImages = true; | ||
private Set<String> redactClasses = new CopyOnWriteArraySet<>(); |
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.
@brustolin @bruno-garcia I guess we should align on naming here. Do you prefer this or redactViewTypes
? I'm fine with either
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 think we should align but just Classes is too generic, what about "redactViewClasses"?
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.
yeah, sounds good. I can also change it to redactViewTypes
so you don't have to :)
Performance metrics 🚀
|
Revision | Plain | With Sentry | Diff |
---|---|---|---|
2c39e81 | 540.60 ms | 628.22 ms | 87.62 ms |
631f884 | 389.28 ms | 439.36 ms | 50.08 ms |
App size
Revision | Plain | With Sentry | Diff |
---|---|---|---|
2c39e81 | 1.70 MiB | 2.35 MiB | 661.12 KiB |
631f884 | 1.70 MiB | 2.35 MiB | 661.11 KiB |
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.
Looks good to me.
One question: We just need to redact TextView? All the input views are based on TextView?
@Deprecated("Getter is unsupported.", level = DeprecationLevel.ERROR) | ||
get() = error("Getter not supported") |
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.
l: Why is this deprecated?
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 explained in a comment on top of the file, but basically we scream to the dev that this should not be used to get the value. This extension only exists to set the value conveniently in Kotlin (redactAllText = true
instead of setRedactAllText(true)
), so only the setter matters 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.
Thanks!! I didn't get the comment.
Can you just remove get()
as in C# where you can have a property with just a setter?
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.
nope, unfortunately not possible in Kotlin. It's possible to only have a getter without a setter, but not the other way around
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.
LGTM!
📜 Description
setTag("sentry-redact|sentry-ignore")
setTag(R.id.sentry_privacy, "redact|ignore")
redactAllText
andredactAllImages
booleans in favour of just adding the android view classes to theredactClasses
listWindows.kt
where we were not properly handling double-init of the SDKAlso note that the order in which we define whether to redact a view or not matters, and marking individual views has precedence over a class. You can read up more on it here: https://www.notion.so/sentry/Redaction-Ignore-Mechanisms-for-Views-45e1302e8d844bd0b83a274a5d759e3f
💡 Motivation and Context
Part of getsentry/sentry#74441
💚 How did you test it?
Manually + automated
📝 Checklist
sendDefaultPII
is enabled.🔮 Next steps