Skip to content

fix: stop screenshot frames being dropped during animations - #529

Merged
ioannisj merged 5 commits into
mainfrom
fix/replay-dropped-frames-t2
May 22, 2026
Merged

fix: stop screenshot frames being dropped during animations#529
ioannisj merged 5 commits into
mainfrom
fix/replay-dropped-frames-t2

Conversation

@ioannisj

@ioannisj ioannisj commented May 22, 2026

Copy link
Copy Markdown
Contributor

💡 Motivation and Context

Follow-up to #524

  • Adds isOnlyAnimationRedraw to distinguish animation-driven redraws from structural layout changes
  • Uses View.hasTransientState() on the decor view as the signal — Android propagates transient state up from any animating descendant, so a single check at the root covers deeply nested LottieAnimationView instances without walking the tree
  • The PII concern is preserved: if a structural change occurs (mask positions could shift), isOnlyAnimationRedraw is false and the screenshot is still discarded. Only pure animation redraws (where view geometry is stable) are allowed through

💚 How did you test it?

Tested on a sample project with lottie animations (here)

  • snapshots don't get dropped because of animated view
  • fast scrolling does not cause masking drift

📝 Checklist

  • I reviewed the submitted code.
  • I added tests to verify the changes.
  • I updated the docs if needed.
  • No breaking change or entry added to the changelog.

If releasing new changes

  • Ran pnpm changeset to generate a changeset file

@ioannisj
ioannisj requested a review from a team as a code owner May 22, 2026 07:37
@marandaneto

Copy link
Copy Markdown
Member

looks like y ou have to update the sha here https://github.com/PostHog/posthog-android/actions/runs/26275242546/job/77337802632?pr=529

@ioannisj
ioannisj merged commit 3cd4742 into main May 22, 2026
13 checks passed
@ioannisj
ioannisj deleted the fix/replay-dropped-frames-t2 branch May 22, 2026 10:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants