getsentry / getsentry/sentry-java

Improve masking for PixelCopyStrategy unstable captures

オープン
#5,493 コメント 2 件 リアクション 1 件 担当者 0 名 GitHub で見る
Android Improvement Replays
主要言語
Kotlin
スター
1.4k
フォーク
478
平均マージ
2日 23時間
マージ済み PR(30日)
67

説明

### 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

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。