Skip to content

fix(android): Keep replay capturing during animations#5489

Draft
romtsn wants to merge 3 commits into
mainfrom
rz/fix/replay-continuous-animations
Draft

fix(android): Keep replay capturing during animations#5489
romtsn wants to merge 3 commits into
mainfrom
rz/fix/replay-continuous-animations

Conversation

@romtsn
Copy link
Copy Markdown
Member

@romtsn romtsn commented Jun 1, 2026

📜 Description

Update Session Replay's PixelCopy strategy so continuously invalidating screens do not freeze after the first unstable capture. The strategy now skips only the first unstable PixelCopy/view-hierarchy pair, then resumes emitting frames while the screen keeps drawing.

Add Android sample screens for Lottie, Compose canvas, and classic View animations so the behavior can be tested manually in the sample app. The sample app remains configured to use the Canvas replay screenshot strategy.

💡 Motivation and Context

Continuous animations can cause PixelCopy output and the view hierarchy snapshot to be taken from slightly different moments. The previous debounce treated this as persistent instability and stopped emitting updated frames, which made replay visuals freeze on animated screens.

Fixes #5404

💚 How did you test it?

./gradlew :sentry-android-replay:testDebugUnitTest --tests io.sentry.android.replay.screenshot.PixelCopyStrategyTest
./gradlew spotlessApply apiDump
./gradlew :sentry-samples:sentry-samples-android:installDebug

difit staged returned no comments before the sample commit.

📝 Checklist

  • I added GH Issue ID & Linear ID
  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.

🔮 Next steps

Manual replay validation on the added animation sample screens.

romtsn and others added 3 commits June 1, 2026 23:32
Skip only the first unstable PixelCopy capture, then continue emitting frames while the screen keeps invalidating. This prevents animated screens from freezing Session Replay visuals while preserving the existing debounce for one-off redraws.

Fixes GH-5404

Co-Authored-By: Codex <noreply@openai.com>
Add separate Android sample screens for Lottie, Compose canvas, and classic View animations so replay capture behavior can be tested manually.

Keep the sample app on the Canvas replay screenshot strategy while exercising these animations.

Refs GH-5404

Co-Authored-By: Codex <noreply@openai.com>
@romtsn romtsn force-pushed the rz/fix/replay-continuous-animations branch from e5fa288 to 05247b6 Compare June 1, 2026 21:33
@sentry
Copy link
Copy Markdown

sentry Bot commented Jun 1, 2026

📲 Install Builds

Android

🔗 App Name App ID Version Configuration
SDK Size io.sentry.tests.size 8.43.0 (1) release

⚙️ sentry-android Build Distribution Settings

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 1, 2026

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 314.69 ms 369.52 ms 54.83 ms
Size 0 B 0 B 0 B

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
f064536 349.86 ms 417.66 ms 67.80 ms
6b019b7 343.31 ms 417.23 ms 73.91 ms
2195398 319.02 ms 342.38 ms 23.36 ms
27d7cf8 369.82 ms 422.62 ms 52.80 ms
cf708bd 408.35 ms 458.98 ms 50.63 ms
22f4345 325.23 ms 454.66 ms 129.43 ms
ad8da22 339.92 ms 407.37 ms 67.45 ms
d217708 411.22 ms 430.86 ms 19.63 ms
b77456b 393.26 ms 441.10 ms 47.84 ms
22f4345 307.87 ms 354.51 ms 46.64 ms

App size

Revision Plain With Sentry Diff
f064536 1.58 MiB 2.20 MiB 633.90 KiB
6b019b7 0 B 0 B 0 B
2195398 0 B 0 B 0 B
27d7cf8 1.58 MiB 2.12 MiB 549.42 KiB
cf708bd 1.58 MiB 2.11 MiB 539.71 KiB
22f4345 1.58 MiB 2.29 MiB 719.83 KiB
ad8da22 1.58 MiB 2.29 MiB 719.83 KiB
d217708 1.58 MiB 2.10 MiB 532.97 KiB
b77456b 1.58 MiB 2.12 MiB 548.11 KiB
22f4345 1.58 MiB 2.29 MiB 719.83 KiB

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.

Session Replay: Continuous animations prevent screenshot capture

1 participant