sentry-dart icon indicating copy to clipboard operation
sentry-dart copied to clipboard

Redact Screenshots via View Hierarchy

Open stefanosiano opened this issue 1 year ago • 14 comments

We have Screenshots, and we have View Hierarchy. For Mobile SR, we use VH to redact SS-based Replays - we should "backport" this functionality to the SS feature.

Rationale: SS can contain PII and other sensitive information, therefore the feature is not viable for some use cases and orgs. Redacting SS via VH enables wider adoption and improves experience for those who already use it.

Let's evaluate:

  1. Implement screeshot redacting and use it for session replay later
  2. Wait for session replay and reuse its implementation for SS and VH

stefanosiano avatar Mar 28 '24 14:03 stefanosiano

Let's wait for SR plans and prioritize this

stefanosiano avatar Mar 28 '24 14:03 stefanosiano

Any update on this feature. It's very important

The-RootCause avatar Mar 31 '24 16:03 The-RootCause

Hi @The-RootCause thanks for your interest - it's very likely we will implement this in the next few months, we'll keep this issue updated with any progress

kahest avatar Apr 02 '24 12:04 kahest

I would love to help contribute this feature since we also need this in our app.

JulianBissekkou avatar Aug 12 '24 07:08 JulianBissekkou

This was brought to my attention by @buenaflor yesterday...

We already have screenshot redacting implemented for replay. As soon as #2208 is merged, the code can be adapted/reused for standard screenshots too.

See WidgetFilter which walks the tree and creates a list of bounding rectangles to redact. Then it's just the question of painting them onto the screenshot

vaind avatar Aug 13 '24 05:08 vaind

@vaind do you know the rough timeline for SR? I was thinking if it makes sense to use the WidgetFilter implementation now outside of the SR branch so we can already implement it for screenshots

buenaflor avatar Aug 13 '24 08:08 buenaflor

@vaind do you know the rough timeline for SR? I was thinking if it makes sense to use the WidgetFilter implementation now outside of the SR branch so we can already implement it for screenshots

I want to make another pre-released today, now that sentry-java has shipped with an update we need. If all goes well, we can merge replay branch to main & still keep it as an alpha feature (i.e. subject to change), since there doesn't seem to be any immediate issue that would require us to roll back these changes. That was the only reason for keeping another branch alive.

vaind avatar Aug 13 '24 09:08 vaind

See WidgetFilter which walks the tree and creates a list of bounding rectangles to redact. Then it's just the question of painting them onto the screenshot

This is now merged to main so this issue is unblocked

vaind avatar Sep 04 '24 08:09 vaind

@martinhaintz I've noticed you've assigned this to yourself. Just be aware there will be changes in the replay redaction logic (thus also in screenshot reduction) in order to support user-configurable widget-level redaction

vaind avatar Sep 25 '24 13:09 vaind

@vaind should we wait here until you've done the changes?

buenaflor avatar Sep 25 '24 14:09 buenaflor

Not sure how far along @martinhaintz is. If he hasn't started yet then yeah, I think it makes sense to deprioritize this for now. If a lot of work is already done on screenshot redacting (I haven't found a PR though) then maybe it makes sense to finish and merge that and I'll fit it together with the changes I'm preparing

vaind avatar Sep 25 '24 14:09 vaind

@martinhaintz wdyt?

buenaflor avatar Sep 25 '24 14:09 buenaflor

@vaind Sorry, for interrupting your plan. As @buenaflor was on vacation, I spoke with @kahest and he assigned it to me via chat.

I currently have no working code and therefore have not created a branch yet. I haven't invested too much time yet. I started with the issue today.

So I will stop working on it since you are already kind of working on it.

martinhaintz avatar Sep 25 '24 14:09 martinhaintz

Alright, I'll ping you. Sorry for the inconvenience

vaind avatar Sep 25 '24 14:09 vaind