Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

- Use logger from options for JVM profiler ([#4771](https://github.com/getsentry/sentry-java/pull/4771))
- Session Replay: Avoid deadlock when pausing replay if no connection ([#4788](https://github.com/getsentry/sentry-java/pull/4788))
- Session Replay: Fix capturing roots with no windows ([#4805](https://github.com/getsentry/sentry-java/pull/4805))
- Session Replay: Fix `java.lang.IllegalArgumentException: width and height must be > 0` ([#4805](https://github.com/getsentry/sentry-java/pull/4805))

### Miscellaneous

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ public data class ScreenshotRecorderConfig(
private fun Int.adjustToBlockSize(): Int {
val remainder = this % 16
return if (remainder <= 8) {
this - remainder
maxOf(16, this - remainder)
} else {
this + (16 - remainder)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,11 @@ internal class WindowRecorder(
override fun onRootViewsChanged(root: View, added: Boolean) {
rootViewsLock.acquire().use {
if (added) {
if (root.phoneWindow == null) {
Copy link
Member Author

Choose a reason for hiding this comment

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

@markushi not sure if this is a problem for the CanvasStrategy - or can it actually still capture this cases?

Copy link
Member

Choose a reason for hiding this comment

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

Hmm we already check for this over here. I guess the phoneWindow can be null when the view is detached or maybe rendered offscreen?

Copy link
Member Author

Choose a reason for hiding this comment

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

right, but my idea was that it's too late to check in ScreenshotRecorder already, because we basically wouldn't capture anything. But when we do this check early enough (here), we don't even track that window and just keep capturing the last known visible one.

options.logger.log(WARNING, "Root view does not have a phone window, skipping.")
return
}

rootViews.add(WeakReference(root))
capturer?.recorder?.bind(root)
determineWindowSize(root)
Expand Down
Loading