[automated] Merge branch 'main' => 'net11.0' - #37851
Closed
github-actions[bot] wants to merge 2 commits into
Closed
Conversation
…ead callers (#37680) <!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. ### Root Cause The regression was introduced when Android screenshot capture switched from synchronous Canvas rendering to asynchronous `PixelCopy` to support hardware-rendered content such as WebView. #35384 `PixelCopy` delivered its completion callback on `Looper.MainLooper`, while Sentry synchronously waited for `Screenshot.Default.CaptureAsync().GetAwaiter().GetResult()` on the UI thread. This created a circular dependency: the UI thread blocked waiting for the screenshot task, and the `PixelCopy` callback could not execute because it also required the UI thread, resulting in a deadlock. ### Description of Change The fix retains `PixelCopy` but moves its completion callback from `Looper.MainLooper` to a shared, process-wide `HandlerThread`, allowing the screenshot task to complete even when the UI thread is synchronously blocked. Additionally, the internal await chain now uses `ConfigureAwait(false)` to avoid resuming on the UI thread. The legacy Canvas/DrawingCache fallback is guarded to run only on the main thread; if `PixelCopy` fails asynchronously on a worker thread, screenshot capture safely returns failure instead of risking off-thread Android View access or recreating the deadlock. ### Regressed By #35384 ### Issues Fixed Fixes #37638 ### Platforms Tested - [ ] iOS - [ ] MacCatalyst - [x] Android - [ ] Windows ### Note The regression test is **Android-only** because the deadlock originates in Android’s PixelCopy callback and main-looper implementation. Other platforms use different screenshot implementations and cannot exercise this code path. The test models Sentry’s relevant synchronous behavior directly to avoid adding a third-party dependency to the shared HostApp. ### Screenshots | Before Issue Fix | After Issue Fix | |------------------|-----------------| | <video width="350" alt="withoutfix" src="https://github.com/user-attachments/assets/72e74130-9f1b-4751-8d36-a777f3fc256c" /> | <video width="350" alt="withfix" src="https://github.com/user-attachments/assets/d4e9c8d2-cfa5-4f03-a8cc-f67fd5fa004f" /> |
Reset patterns: - global.json - NuGet.config - eng/Version.Details.xml - eng/Versions.props - eng/common/*
|
Azure Pipelines: Successfully started running 1 pipeline(s). There may be pipelines that require an authorized user to comment /azp run to run. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I detected changes in the main branch which have not been merged yet to net11.0. I'm a robot and am configured to help you automatically keep net11.0 up to date, so I've opened this PR.
This PR merges commits made on main by the following committers:
Instructions for merging from UI
This PR will not be auto-merged. When pull request checks pass, complete this PR by creating a merge commit, not a squash or rebase commit.
If this repo does not allow creating merge commits from the GitHub UI, use command line instructions.
Instructions for merging via command line
Run these commands to merge this pull request from the command line.
or if you are using SSH
After PR checks are complete push the branch
Instructions for resolving conflicts
Instructions for updating this pull request
Contributors to this repo have permission update this pull request by pushing to the branch 'merge/main-to-net11.0'. This can be done to resolve conflicts or make other changes to this pull request before it is merged.
The provided examples assume that the remote is named 'origin'. If you have a different remote name, please replace 'origin' with the name of your remote.
or if you are using SSH
Contact .NET Core Engineering (dotnet/dnceng) if you have questions or issues.
Also, if this PR was generated incorrectly, help us fix it. See https://github.com/dotnet/arcade/blob/main/.github/workflows/scripts/inter-branch-merge.ps1.