Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/warm-pixels-glow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'posthog-android': patch
---

Fix session replay screenshot PII leak on PixelCopy timeout and improve masking loop early exit
Original file line number Diff line number Diff line change
Expand Up @@ -982,13 +982,13 @@ public class PostHogReplayIntegration(
return@request
}

maskableWidgets.forEach {
for (rect in maskableWidgets) {
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not a bug but wasting cycles

if (isOnDrawnCalled) {
config.logger.log("Session Replay screenshot discarded due to screen changes.")
success = false
return@forEach
break
}
canvas.drawRoundRect(RectF(it), 10f, 10f, paint)
canvas.drawRoundRect(RectF(rect), 10f, 10f, paint)
}
} else {
config.logger.log("Session Replay screenshot discarded due to screen changes.")
Expand Down Expand Up @@ -1021,9 +1021,9 @@ public class PostHogReplayIntegration(

try {
// await for 1s max
latch.await(1000, TimeUnit.MILLISECONDS)
val completed = latch.await(1000, TimeUnit.MILLISECONDS)
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the PixelCopy callback can take longer than the 1-second latch timeout

very unlikely but doing the change anyway


if (success) {
if (completed && success) {
base64 = bitmap.webpBase64()
}
} catch (e: Throwable) {
Expand Down
Loading