Skip to content

[automated] Merge branch 'main' => 'net11.0' - #37851

Closed
github-actions[bot] wants to merge 2 commits into
net11.0from
merge/main-to-net11.0
Closed

[automated] Merge branch 'main' => 'net11.0'#37851
github-actions[bot] wants to merge 2 commits into
net11.0from
merge/main-to-net11.0

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

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:

  • praveenkumarkarunanithi

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.

merge button instructions

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.

git fetch
git checkout main
git pull --ff-only
git checkout net11.0
git pull --ff-only
git merge --no-ff main

# If there are merge conflicts, resolve them and then run git merge --continue to complete the merge
# Pushing the changes to the PR branch will re-trigger PR validation.
git push https://github.com/dotnet/maui HEAD:merge/main-to-net11.0
or if you are using SSH
git push git@github.com:dotnet/maui HEAD:merge/main-to-net11.0

After PR checks are complete push the branch

git push

Instructions for resolving conflicts

⚠️ If there are merge conflicts, you will need to resolve them manually before merging. You can do this using GitHub or using the command line.

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.

git fetch
git checkout -b merge/main-to-net11.0 origin/net11.0
git pull https://github.com/dotnet/maui merge/main-to-net11.0
(make changes)
git commit -m "Updated PR with my changes"
git push https://github.com/dotnet/maui HEAD:merge/main-to-net11.0
or if you are using SSH
git fetch
git checkout -b merge/main-to-net11.0 origin/net11.0
git pull git@github.com:dotnet/maui merge/main-to-net11.0
(make changes)
git commit -m "Updated PR with my changes"
git push git@github.com:dotnet/maui HEAD:merge/main-to-net11.0

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.

…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

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
There may be pipelines that require an authorized user to comment /azp run to run.

@dotnet-policy-service dotnet-policy-service Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Auto-approved automated inter-branch merge.

@kubaflo kubaflo closed this Aug 26, 2026
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