getsentry / getsentry/sentry-java

Improve masking for PixelCopyStrategy unstable captures

Ouverte
#5,493 2 commentaires 1 réaction 0 personnes assignées Voir sur GitHub
Android Improvement Replays
Langage dominant
Kotlin
Étoiles
1.4k
Forks
478
Merge moyen
2 j 23 h
PR mergées (30 j)
67

Description

### Description

from @0xadam-brown

> Not sure if we want the extra security, but we could also consider:
>
> increasing the mask size when recording unstable captures, or
> covering the view's entire range of possible positions during the unstable window, ie, the union of where it was (in the pixels, time T) and where the hierarchy thinks it is (T+delta).

I put this into codex, and this is its analysis:
```
Option 1, "increase mask size for unstable captures," is the only reasonably small one. Mechanically it's not huge: add an unstableMaskPaddingPx or similar parameter to
MaskRenderer.renderMasks(...), inflate mask rects when changedDuringCapture == true, clamp them, and update debug overlay/tests. The tricky part is picking a padding that actually helps
without making replay look over-masked. A fixed 8-16dp helps slow movement, but won't cover fast animations, scrolling, shared-element transitions, keyboard movement, etc.

Option 2, "union where it was and where hierarchy thinks it is," is a much bigger lift. We don't currently have a hierarchy snapshot at PixelCopy's exact copy time. To approximate it,
we'd need to capture hierarchy before PixelCopy and after PixelCopy, then match nodes across snapshots. That gets messy for Compose nodes, text line masks, list recycling, visibility
changes, and any node without stable identity. It also adds more main-thread traversal work, which works against the ANR/perf goal.
```

so this probably needs some refinement/further brainstorming

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.