[Android] Fix custom WebViewClient being overridden by MAUI handler mapper#34426
[Android] Fix custom WebViewClient being overridden by MAUI handler mapper#34426NirmalKumarYuvaraj wants to merge 5 commits into
Conversation
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 34426Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 34426" |
9074806 to
2486d91
Compare
|
@kubaflo , Addressed Test case failures. Please let me know if you have any concerns. |
There was a problem hiding this comment.
Pull request overview
Fixes an Android handler lifecycle issue in .NET MAUI where WebViewHandler’s property mapper would overwrite a custom WebViewClient set by apps in ConnectHandler, preventing reliable ShouldOverrideUrlLoading interception.
Changes:
- Remove
MapWebViewClient/MapWebChromeClientfrom the Android property mapper and initialize default clients once during platform view creation. - Update Android
DisconnectHandlerto disconnect/dispose stored client instances instead of casting from the platform view. - Add a new HostApp repro page + UITest coverage for issue #34392 to validate custom
WebViewClientbehavior.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Core/src/PublicAPI/net-android/PublicAPI.Unshipped.txt | Records removal of Android WebViewHandler mapper APIs (but currently conflicts with shipped API state). |
| src/Core/src/Handlers/WebView/WebViewHandler.cs | Removes Android mapper entries that were reassigning clients after ConnectHandler. |
| src/Core/src/Handlers/WebView/WebViewHandler.Android.cs | Creates default MauiWebViewClient/MauiWebChromeClient in CreatePlatformView() and adjusts disconnect/disposal behavior. |
| src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue34392.cs | Adds an Android-only UITest to validate ShouldOverrideUrlLoading gets called. |
| src/Controls/tests/TestCases.HostApp/MauiProgram.cs | Registers the custom handler used for the repro/test. |
| src/Controls/tests/TestCases.HostApp/Issues/Issue34392.cs | Adds the HostApp issue page + custom WebView/handler/client used by the test. |
Comments suppressed due to low confidence (1)
src/Core/src/Handlers/WebView/WebViewHandler.Android.cs:97
- The PR removes
MapWebViewClient/MapWebChromeClientmethods, but these APIs are already listed insrc/Core/src/PublicAPI/net-android/PublicAPI.Shipped.txt. Removing shipped public APIs is a breaking change and will also cause PublicAPI analyzer failures unless handled as a shipped removal. Prefer keeping these methods (even if they’re no longer used by the mapper) and/or marking them obsolete, rather than deleting them outright.
public static void MapSource(IWebViewHandler handler, IWebView webView)
{
ProcessSourceWhenReady(handler, webView);
}
public static void MapUserAgent(IWebViewHandler handler, IWebView webView)
{
handler.PlatformView.UpdateUserAgent(webView);
}
public static void MapWebViewSettings(IWebViewHandler handler, IWebView webView)
{
handler.PlatformView.UpdateSettings(webView, true, true);
}
kubaflo
left a comment
There was a problem hiding this comment.
Could you please check copilot's suggestions and the ai's summary?
|
@kubaflo , Addressed AI summary. |
kubaflo
left a comment
There was a problem hiding this comment.
Could you please resolve conflicts?
596bd28 to
6e9af5b
Compare
|
@kubaflo , Rebased and resolved the conflicts. Please let me know if you have any concern. |
🚦 Gate — Test Before and After Fix
🚦 Gate Session —
|
| Test | Without Fix (expect FAIL) | With Fix (expect PASS) |
|---|---|---|
🖥️ Issue34392 Issue34392 |
✅ PASS — 531s |
🔴 Without fix — 🖥️ Issue34392: ⚠️ ENV ERROR · 1727s
(truncated to last 15,000 chars)
tApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/.dotnet/packs/Microsoft.Android.Sdk.Linux/36.1.2/tools/Xamarin.Android.Common.Debugging.targets(333,5): error ADB0010: at Xamarin.Android.Tasks.FastDeploy.InstallPackage(Boolean installed) [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/.dotnet/packs/Microsoft.Android.Sdk.Linux/36.1.2/tools/Xamarin.Android.Common.Debugging.targets(333,5): error ADB0010: at Xamarin.Android.Tasks.FastDeploy.InstallPackage(Boolean installed) [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/.dotnet/packs/Microsoft.Android.Sdk.Linux/36.1.2/tools/Xamarin.Android.Common.Debugging.targets(333,5): error ADB0010: at Xamarin.Android.Tasks.FastDeploy.RunInstall() [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
Build FAILED.
/home/vsts/work/1/s/.dotnet/packs/Microsoft.Android.Sdk.Linux/36.1.2/tools/Xamarin.Android.Common.Debugging.targets(333,5): error ADB0010: Mono.AndroidTools.InstallFailedException: Unexpected install output: cmd: Failure calling service package: Broken pipe (32) [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/.dotnet/packs/Microsoft.Android.Sdk.Linux/36.1.2/tools/Xamarin.Android.Common.Debugging.targets(333,5): error ADB0010: [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/.dotnet/packs/Microsoft.Android.Sdk.Linux/36.1.2/tools/Xamarin.Android.Common.Debugging.targets(333,5): error ADB0010: at Mono.AndroidTools.Internal.AdbOutputParsing.CheckInstallSuccess(String output, String packageName) [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/.dotnet/packs/Microsoft.Android.Sdk.Linux/36.1.2/tools/Xamarin.Android.Common.Debugging.targets(333,5): error ADB0010: at Mono.AndroidTools.AndroidDevice.<>c__DisplayClass105_0.<InstallPackage>b__0(Task`1 t) [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/.dotnet/packs/Microsoft.Android.Sdk.Linux/36.1.2/tools/Xamarin.Android.Common.Debugging.targets(333,5): error ADB0010: at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/.dotnet/packs/Microsoft.Android.Sdk.Linux/36.1.2/tools/Xamarin.Android.Common.Debugging.targets(333,5): error ADB0010: --- End of stack trace from previous location --- [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/.dotnet/packs/Microsoft.Android.Sdk.Linux/36.1.2/tools/Xamarin.Android.Common.Debugging.targets(333,5): error ADB0010: at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/.dotnet/packs/Microsoft.Android.Sdk.Linux/36.1.2/tools/Xamarin.Android.Common.Debugging.targets(333,5): error ADB0010: at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread) [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/.dotnet/packs/Microsoft.Android.Sdk.Linux/36.1.2/tools/Xamarin.Android.Common.Debugging.targets(333,5): error ADB0010: --- End of stack trace from previous location --- [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/.dotnet/packs/Microsoft.Android.Sdk.Linux/36.1.2/tools/Xamarin.Android.Common.Debugging.targets(333,5): error ADB0010: at AndroidDeviceExtensions.PushAndInstallPackageAsync(AndroidDevice device, PushAndInstallCommand command, CancellationToken token) [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/.dotnet/packs/Microsoft.Android.Sdk.Linux/36.1.2/tools/Xamarin.Android.Common.Debugging.targets(333,5): error ADB0010: at AndroidDeviceExtensions.PushAndInstallPackageAsync(AndroidDevice device, PushAndInstallCommand command, CancellationToken token) [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/.dotnet/packs/Microsoft.Android.Sdk.Linux/36.1.2/tools/Xamarin.Android.Common.Debugging.targets(333,5): error ADB0010: at Xamarin.Android.Tasks.FastDeploy.InstallPackage(Boolean installed) [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/.dotnet/packs/Microsoft.Android.Sdk.Linux/36.1.2/tools/Xamarin.Android.Common.Debugging.targets(333,5): error ADB0010: at Xamarin.Android.Tasks.FastDeploy.InstallPackage(Boolean installed) [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/.dotnet/packs/Microsoft.Android.Sdk.Linux/36.1.2/tools/Xamarin.Android.Common.Debugging.targets(333,5): error ADB0010: at Xamarin.Android.Tasks.FastDeploy.RunInstall() [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
0 Warning(s)
1 Error(s)
Time Elapsed 00:16:12.29
* daemon not running; starting now at tcp:5037
* daemon started successfully
Determining projects to restore...
All projects are up-to-date for restore.
##vso[build.updatebuildnumber]10.0.60-ci+azdo.13819754
Graphics -> /home/vsts/work/1/s/artifacts/bin/Graphics/Debug/net10.0-android36.0/Microsoft.Maui.Graphics.dll
##vso[build.updatebuildnumber]10.0.60-ci+azdo.13819754
Essentials -> /home/vsts/work/1/s/artifacts/bin/Essentials/Debug/net10.0-android36.0/Microsoft.Maui.Essentials.dll
##vso[build.updatebuildnumber]10.0.60-ci+azdo.13819754
Core -> /home/vsts/work/1/s/artifacts/bin/Core/Debug/net10.0-android36.0/Microsoft.Maui.dll
Controls.BindingSourceGen -> /home/vsts/work/1/s/artifacts/bin/Controls.BindingSourceGen/Debug/netstandard2.0/Microsoft.Maui.Controls.BindingSourceGen.dll
##vso[build.updatebuildnumber]10.0.60-ci+azdo.13819754
##vso[build.updatebuildnumber]10.0.60-ci+azdo.13819754
Maps -> /home/vsts/work/1/s/artifacts/bin/Maps/Debug/net10.0-android36.0/Microsoft.Maui.Maps.dll
Controls.Core -> /home/vsts/work/1/s/artifacts/bin/Controls.Core/Debug/net10.0-android36.0/Microsoft.Maui.Controls.dll
##vso[build.updatebuildnumber]10.0.60-ci+azdo.13819754
##vso[build.updatebuildnumber]10.0.60-ci+azdo.13819754
Controls.Xaml -> /home/vsts/work/1/s/artifacts/bin/Controls.Xaml/Debug/net10.0-android36.0/Microsoft.Maui.Controls.Xaml.dll
Controls.Maps -> /home/vsts/work/1/s/artifacts/bin/Controls.Maps/Debug/net10.0-android36.0/Microsoft.Maui.Controls.Maps.dll
##vso[build.updatebuildnumber]10.0.60-ci+azdo.13819754
##vso[build.updatebuildnumber]10.0.60-ci+azdo.13819754
Microsoft.AspNetCore.Components.WebView.Maui -> /home/vsts/work/1/s/artifacts/bin/Microsoft.AspNetCore.Components.WebView.Maui/Debug/net10.0-android36.0/Microsoft.AspNetCore.Components.WebView.Maui.dll
Controls.Foldable -> /home/vsts/work/1/s/artifacts/bin/Controls.Foldable/Debug/net10.0-android36.0/Microsoft.Maui.Controls.Foldable.dll
Controls.TestCases.HostApp -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Controls.TestCases.HostApp.dll
##vso[build.updatebuildnumber]10.0.60-ci+azdo.13819754
Graphics -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.Graphics.dll
##vso[build.updatebuildnumber]10.0.60-ci+azdo.13819754
Essentials -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.Essentials.dll
##vso[build.updatebuildnumber]10.0.60-ci+azdo.13819754
Core -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.dll
Controls.BindingSourceGen -> /home/vsts/work/1/s/artifacts/bin/Controls.BindingSourceGen/Debug/netstandard2.0/Microsoft.Maui.Controls.BindingSourceGen.dll
##vso[build.updatebuildnumber]10.0.60-ci+azdo.13819754
##vso[build.updatebuildnumber]10.0.60-ci+azdo.13819754
Maps -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.Maps.dll
Controls.Core -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.Controls.dll
##vso[build.updatebuildnumber]10.0.60-ci+azdo.13819754
##vso[build.updatebuildnumber]10.0.60-ci+azdo.13819754
##vso[build.updatebuildnumber]10.0.60-ci+azdo.13819754
Controls.Xaml -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.Controls.Xaml.dll
Microsoft.AspNetCore.Components.WebView.Maui -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.AspNetCore.Components.WebView.Maui.dll
##vso[build.updatebuildnumber]10.0.60-ci+azdo.13819754
Controls.Foldable -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.Controls.Foldable.dll
Controls.Maps -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.Controls.Maps.dll
Build succeeded.
0 Warning(s)
0 Error(s)
Time Elapsed 00:08:51.05
Broadcasting: Intent { act=android.intent.action.CLOSE_SYSTEM_DIALOGS flg=0x400000 }
Broadcast completed: result=0
Broadcasting: Intent { act=android.intent.action.CLOSE_SYSTEM_DIALOGS flg=0x400000 }
Broadcast completed: result=0
Determining projects to restore...
Restored /home/vsts/work/1/s/src/Controls/tests/CustomAttributes/Controls.CustomAttributes.csproj (in 1.14 sec).
Restored /home/vsts/work/1/s/src/TestUtils/src/VisualTestUtils/VisualTestUtils.csproj (in 10 ms).
Restored /home/vsts/work/1/s/src/TestUtils/src/VisualTestUtils.MagickNet/VisualTestUtils.MagickNet.csproj (in 4.65 sec).
Restored /home/vsts/work/1/s/src/Controls/tests/TestCases.Android.Tests/Controls.TestCases.Android.Tests.csproj (in 6.03 sec).
Restored /home/vsts/work/1/s/src/TestUtils/src/UITest.Core/UITest.Core.csproj (in 2 ms).
Restored /home/vsts/work/1/s/src/TestUtils/src/UITest.Appium/UITest.Appium.csproj (in 2 ms).
Restored /home/vsts/work/1/s/src/TestUtils/src/UITest.NUnit/UITest.NUnit.csproj (in 378 ms).
Restored /home/vsts/work/1/s/src/TestUtils/src/UITest.Analyzers/UITest.Analyzers.csproj (in 2.09 sec).
5 of 13 projects are up-to-date for restore.
##vso[build.updatebuildnumber]10.0.60-ci+azdo.13819754
Controls.CustomAttributes -> /home/vsts/work/1/s/artifacts/bin/Controls.CustomAttributes/Debug/net10.0/Controls.CustomAttributes.dll
Graphics -> /home/vsts/work/1/s/artifacts/bin/Graphics/Debug/net10.0/Microsoft.Maui.Graphics.dll
##vso[build.updatebuildnumber]10.0.60-ci+azdo.13819754
Essentials -> /home/vsts/work/1/s/artifacts/bin/Essentials/Debug/net10.0/Microsoft.Maui.Essentials.dll
##vso[build.updatebuildnumber]10.0.60-ci+azdo.13819754
Core -> /home/vsts/work/1/s/artifacts/bin/Core/Debug/net10.0/Microsoft.Maui.dll
Controls.BindingSourceGen -> /home/vsts/work/1/s/artifacts/bin/Controls.BindingSourceGen/Debug/netstandard2.0/Microsoft.Maui.Controls.BindingSourceGen.dll
##vso[build.updatebuildnumber]10.0.60-ci+azdo.13819754
Controls.Core -> /home/vsts/work/1/s/artifacts/bin/Controls.Core/Debug/net10.0/Microsoft.Maui.Controls.dll
UITest.Core -> /home/vsts/work/1/s/artifacts/bin/UITest.Core/Debug/net10.0/UITest.Core.dll
UITest.Appium -> /home/vsts/work/1/s/artifacts/bin/UITest.Appium/Debug/net10.0/UITest.Appium.dll
VisualTestUtils -> /home/vsts/work/1/s/artifacts/bin/VisualTestUtils/Debug/netstandard2.0/VisualTestUtils.dll
UITest.NUnit -> /home/vsts/work/1/s/artifacts/bin/UITest.NUnit/Debug/net10.0/UITest.NUnit.dll
VisualTestUtils.MagickNet -> /home/vsts/work/1/s/artifacts/bin/VisualTestUtils.MagickNet/Debug/netstandard2.0/VisualTestUtils.MagickNet.dll
UITest.Analyzers -> /home/vsts/work/1/s/artifacts/bin/UITest.Analyzers/Debug/netstandard2.0/UITest.Analyzers.dll
Controls.TestCases.Android.Tests -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.Android.Tests/Debug/net10.0/Controls.TestCases.Android.Tests.dll
Test run for /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.Android.Tests/Debug/net10.0/Controls.TestCases.Android.Tests.dll (.NETCoreApp,Version=v10.0)
VSTest version 18.0.1 (x64)
Starting test execution, please wait...
A total of 1 test files matched the specified pattern.
/home/vsts/work/1/s/artifacts/bin/Controls.TestCases.Android.Tests/Debug/net10.0/Controls.TestCases.Android.Tests.dll
[xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v2.8.2+699d445a1a (64-bit .NET 10.0.0)
[xUnit.net 00:00:00.12] Discovering: Controls.TestCases.Android.Tests
[xUnit.net 00:00:00.34] Discovered: Controls.TestCases.Android.Tests
NUnit Adapter 4.5.0.0: Test execution started
Running selected tests in /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.Android.Tests/Debug/net10.0/Controls.TestCases.Android.Tests.dll
NUnit3TestExecutor discovered 1 of 1 NUnit test cases using Current Discovery mode, Non-Explicit run
>>>>> 04/13/2026 18:33:16 FixtureSetup for Issue34392(Android)
>>>>> 04/13/2026 18:33:21 ShouldOverrideUrlLoading_Called Start
>>>>> 04/13/2026 18:33:31 ShouldOverrideUrlLoading_Called Stop
>>>>> 04/13/2026 18:33:31 Log types: logcat, bugreport, server
Failed ShouldOverrideUrlLoading_Called [11 s]
Error Message:
Expected ShouldOverrideUrlLoading to be called and update the status label text to 'SUCCESS', but it was not updated within the timeout.
Assert.That(result, Is.True)
Expected: True
But was: False
Stack Trace:
at Microsoft.Maui.TestCases.Tests.Issues.Issue34392.ShouldOverrideUrlLoading_Called() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue34392.cs:line 22
1) at Microsoft.Maui.TestCases.Tests.Issues.Issue34392.ShouldOverrideUrlLoading_Called() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue34392.cs:line 22
NUnit Adapter 4.5.0.0: Test execution complete
Test Run Failed.
Total tests: 1
Failed: 1
Total time: 36.1530 Seconds
🟢 With fix — 🖥️ Issue34392: PASS ✅ · 531s
Determining projects to restore...
All projects are up-to-date for restore.
##vso[build.updatebuildnumber]10.0.60-ci+azdo.13819754
Graphics -> /home/vsts/work/1/s/artifacts/bin/Graphics/Debug/net10.0-android36.0/Microsoft.Maui.Graphics.dll
##vso[build.updatebuildnumber]10.0.60-ci+azdo.13819754
Essentials -> /home/vsts/work/1/s/artifacts/bin/Essentials/Debug/net10.0-android36.0/Microsoft.Maui.Essentials.dll
##vso[build.updatebuildnumber]10.0.60-ci+azdo.13819754
Core -> /home/vsts/work/1/s/artifacts/bin/Core/Debug/net10.0-android36.0/Microsoft.Maui.dll
Controls.BindingSourceGen -> /home/vsts/work/1/s/artifacts/bin/Controls.BindingSourceGen/Debug/netstandard2.0/Microsoft.Maui.Controls.BindingSourceGen.dll
##vso[build.updatebuildnumber]10.0.60-ci+azdo.13819754
##vso[build.updatebuildnumber]10.0.60-ci+azdo.13819754
Maps -> /home/vsts/work/1/s/artifacts/bin/Maps/Debug/net10.0-android36.0/Microsoft.Maui.Maps.dll
Controls.Core -> /home/vsts/work/1/s/artifacts/bin/Controls.Core/Debug/net10.0-android36.0/Microsoft.Maui.Controls.dll
##vso[build.updatebuildnumber]10.0.60-ci+azdo.13819754
##vso[build.updatebuildnumber]10.0.60-ci+azdo.13819754
##vso[build.updatebuildnumber]10.0.60-ci+azdo.13819754
##vso[build.updatebuildnumber]10.0.60-ci+azdo.13819754
Controls.Xaml -> /home/vsts/work/1/s/artifacts/bin/Controls.Xaml/Debug/net10.0-android36.0/Microsoft.Maui.Controls.Xaml.dll
Microsoft.AspNetCore.Components.WebView.Maui -> /home/vsts/work/1/s/artifacts/bin/Microsoft.AspNetCore.Components.WebView.Maui/Debug/net10.0-android36.0/Microsoft.AspNetCore.Components.WebView.Maui.dll
Controls.Maps -> /home/vsts/work/1/s/artifacts/bin/Controls.Maps/Debug/net10.0-android36.0/Microsoft.Maui.Controls.Maps.dll
Controls.Foldable -> /home/vsts/work/1/s/artifacts/bin/Controls.Foldable/Debug/net10.0-android36.0/Microsoft.Maui.Controls.Foldable.dll
Controls.TestCases.HostApp -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Controls.TestCases.HostApp.dll
##vso[build.updatebuildnumber]10.0.60-ci+azdo.13819754
Graphics -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.Graphics.dll
##vso[build.updatebuildnumber]10.0.60-ci+azdo.13819754
Essentials -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.Essentials.dll
##vso[build.updatebuildnumber]10.0.60-ci+azdo.13819754
Core -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.dll
Controls.BindingSourceGen -> /home/vsts/work/1/s/artifacts/bin/Controls.BindingSourceGen/Debug/netstandard2.0/Microsoft.Maui.Controls.BindingSourceGen.dll
##vso[build.updatebuildnumber]10.0.60-ci+azdo.13819754
##vso[build.updatebuildnumber]10.0.60-ci+azdo.13819754
Maps -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.Maps.dll
Controls.Core -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.Controls.dll
##vso[build.updatebuildnumber]10.0.60-ci+azdo.13819754
##vso[build.updatebuildnumber]10.0.60-ci+azdo.13819754
##vso[build.updatebuildnumber]10.0.60-ci+azdo.13819754
##vso[build.updatebuildnumber]10.0.60-ci+azdo.13819754
Controls.Xaml -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.Controls.Xaml.dll
Microsoft.AspNetCore.Components.WebView.Maui -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.AspNetCore.Components.WebView.Maui.dll
Controls.Maps -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.Controls.Maps.dll
Controls.Foldable -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.Controls.Foldable.dll
Build succeeded.
0 Warning(s)
0 Error(s)
Time Elapsed 00:06:56.69
Broadcasting: Intent { act=android.intent.action.CLOSE_SYSTEM_DIALOGS flg=0x400000 }
Broadcast completed: result=0
Broadcasting: Intent { act=android.intent.action.CLOSE_SYSTEM_DIALOGS flg=0x400000 }
Broadcast completed: result=0
Determining projects to restore...
All projects are up-to-date for restore.
Controls.CustomAttributes -> /home/vsts/work/1/s/artifacts/bin/Controls.CustomAttributes/Debug/net10.0/Controls.CustomAttributes.dll
##vso[build.updatebuildnumber]10.0.60-ci+azdo.13819754
Graphics -> /home/vsts/work/1/s/artifacts/bin/Graphics/Debug/net10.0/Microsoft.Maui.Graphics.dll
##vso[build.updatebuildnumber]10.0.60-ci+azdo.13819754
Essentials -> /home/vsts/work/1/s/artifacts/bin/Essentials/Debug/net10.0/Microsoft.Maui.Essentials.dll
##vso[build.updatebuildnumber]10.0.60-ci+azdo.13819754
Core -> /home/vsts/work/1/s/artifacts/bin/Core/Debug/net10.0/Microsoft.Maui.dll
Controls.BindingSourceGen -> /home/vsts/work/1/s/artifacts/bin/Controls.BindingSourceGen/Debug/netstandard2.0/Microsoft.Maui.Controls.BindingSourceGen.dll
##vso[build.updatebuildnumber]10.0.60-ci+azdo.13819754
Controls.Core -> /home/vsts/work/1/s/artifacts/bin/Controls.Core/Debug/net10.0/Microsoft.Maui.Controls.dll
UITest.Core -> /home/vsts/work/1/s/artifacts/bin/UITest.Core/Debug/net10.0/UITest.Core.dll
VisualTestUtils -> /home/vsts/work/1/s/artifacts/bin/VisualTestUtils/Debug/netstandard2.0/VisualTestUtils.dll
UITest.NUnit -> /home/vsts/work/1/s/artifacts/bin/UITest.NUnit/Debug/net10.0/UITest.NUnit.dll
VisualTestUtils.MagickNet -> /home/vsts/work/1/s/artifacts/bin/VisualTestUtils.MagickNet/Debug/netstandard2.0/VisualTestUtils.MagickNet.dll
UITest.Appium -> /home/vsts/work/1/s/artifacts/bin/UITest.Appium/Debug/net10.0/UITest.Appium.dll
UITest.Analyzers -> /home/vsts/work/1/s/artifacts/bin/UITest.Analyzers/Debug/netstandard2.0/UITest.Analyzers.dll
Controls.TestCases.Android.Tests -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.Android.Tests/Debug/net10.0/Controls.TestCases.Android.Tests.dll
Test run for /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.Android.Tests/Debug/net10.0/Controls.TestCases.Android.Tests.dll (.NETCoreApp,Version=v10.0)
VSTest version 18.0.1 (x64)
Starting test execution, please wait...
A total of 1 test files matched the specified pattern.
/home/vsts/work/1/s/artifacts/bin/Controls.TestCases.Android.Tests/Debug/net10.0/Controls.TestCases.Android.Tests.dll
[xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v2.8.2+699d445a1a (64-bit .NET 10.0.0)
[xUnit.net 00:00:00.21] Discovering: Controls.TestCases.Android.Tests
[xUnit.net 00:00:00.81] Discovered: Controls.TestCases.Android.Tests
NUnit Adapter 4.5.0.0: Test execution started
Running selected tests in /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.Android.Tests/Debug/net10.0/Controls.TestCases.Android.Tests.dll
NUnit3TestExecutor discovered 1 of 1 NUnit test cases using Current Discovery mode, Non-Explicit run
>>>>> 04/13/2026 18:42:50 FixtureSetup for Issue34392(Android)
>>>>> 04/13/2026 18:42:53 ShouldOverrideUrlLoading_Called Start
>>>>> 04/13/2026 18:42:56 ShouldOverrideUrlLoading_Called Stop
Passed ShouldOverrideUrlLoading_Called [3 s]
NUnit Adapter 4.5.0.0: Test execution complete
Test Run Successful.
Total tests: 1
Passed: 1
Total time: 20.5294 Seconds
⚠️ Issues found
⚠️ Issue34392 without fix:Exception calling "Matches" with "2" argument(s): "Value cannot be null. (Parameter 'input')"
📁 Fix files reverted (13 files)
eng/pipelines/ci-copilot.ymleng/pipelines/ci-official.ymlsrc/Controls/src/Core/Handlers/Items/Android/TemplatedItemViewHolder.cssrc/Controls/src/SourceGen/Descriptors.cssrc/Controls/src/SourceGen/GeneratorHelpers.cssrc/Controls/src/SourceGen/InitializeComponentCodeWriter.cssrc/Controls/src/SourceGen/TrackingNames.cssrc/Controls/src/SourceGen/Visitors/SetPropertiesVisitor.cssrc/Controls/src/SourceGen/XamlGenerator.cssrc/Controls/src/Xaml/XmlName.cssrc/Core/src/Handlers/WebView/WebViewHandler.Android.cssrc/Core/src/Handlers/WebView/WebViewHandler.cssrc/Core/src/PublicAPI/net-android/PublicAPI.Unshipped.txt
New files (not reverted):
src/Controls/src/SourceGen/XCodeCodeWriter.cs
6e9af5b to
8d71e61
Compare
|
@kubaflo , I think we can target this branch to net 11. |
|
@jfversluis do you think this change should be included in net11? |
|
/review -b feature/refactor-copilot-yml |
…, update stale comment - Add VerifyInternetConnectivity() call before WebView test assertion - Use WaitForElement with predicate to wait for 'SUCCESS' text instead of racing - Update stale comment referencing removed webclients mappers - Add trailing newline to test files Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
8d71e61 to
85d588c
Compare
|
/review -b feature/refactor-copilot-yml -p android |
|
|
AI code review for net11.0 targetVerdict: Needs changes Non-approval automated review (no human approval implied). Independent diff-first pass, then reconciled with the PR description. The core idea is sound: Key findings:
Test: the added Android UI test ( CI: required pipelines are red. Several failures (AOT macOS, Confidence: medium-high on the API-26 getter regression (mirrors the pre-existing guard); medium on CI attribution. |
|
@kubaflo , Addressed AI concerns. |
|
/review rerun |
|
Reviewing test failures on this PR... Review PR Test Failures |
|
/review -b feature/regression-check -p android |
|
Reviewing test failures on this PR... Review PR Test Failures |
AI code review refresh for net11.0 targetVerdict: LGTM (with CI caveat) Head reviewed: 235b48e Non-approval automated review (no human approval implied). Independent diff-first pass, then reconciled with the PR narrative and prior round's findings. This commit ("addressed ai concerns") resolves both issues raised in the previous round:
Disconnect/dispose paths trace cleanly across all four cases (default vs. custom-replaced × API≥26 vs. <26): the active client is disconnected (when it's a Minor (non-blocking): on API <26 the cached Test: CI: required pipelines are red, but the failures do not appear PR-caused. This change is Android-only (the modified Core file is Confidence: high on the code correctness (both prior concerns verifiably fixed, dispose paths traced); medium-high on CI being unrelated infra given the Android-only surface area. Automated net11.0 refresh review — not an approval or merge authorization. |
<!-- 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. Thank you! ## Summary - Recognizes the `MauiBot` account as the AI Summary author for `/review rerun` eligibility. - Replaces duplicated author regex checks with one allowlist helper used by AI Summary detection and bot-comment rejection. - Adds regression coverage based on #34426 comments 4239128463 and 4658057491. ## Validation - `Invoke-Pester .github/scripts/Resolve-RerunEligibility.Tests.ps1,.github/scripts/Invoke-RerunReviewTrigger.Tests.ps1 -CI` - `Resolve-RerunEligibility.ps1 -PRNumber 34426 -CurrentCommentId 4658995396` returned `Rerun eligibility: True (new-head-commit)` - Verified the patched helper selects AI Summary comment `4239128463` authored by `MauiBot`. ## Fixes - Follow-up to #35685 --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Synthesized multi-model review — PR #34426Verdict: NEEDS_DISCUSSION · confidence: medium-high · inline: 0 Reconciliation (why the models split)The disagreement is about non-code gating items, not correctness — the fix itself is correct and traces cleanly (independently re-verified at the review SHA). Gemini mis-analyzed the disconnect/dispose flow and over-escalated two already-discussed, non-blocking design points to NEEDS_CHANGES, while gpt-5.5/opus-4.8 correctly found no new blocking code error. The remaining spread (opus-4.6 LGTM vs. gpt-5.5/opus-4.8 ND) is purely tolerance for red-but-unrelated required CI plus an unresolved intentional binary-API removal: opus-4.6 dismissed both; the ND models (and this synthesis) treat them as genuine open items. Validated findings
Why NEEDS_DISCUSSION (not NC, not clean LGTM)No confirmed code error and no PR-caused CI block → not NEEDS_CHANGES (the earlier API-26 getter regression was already fixed and re-verified). But two real pre-merge items remain open in-thread: the intentional shipped-API removal (net11 break) awaiting maintainer sign-off, and red required CI awaiting known-issue confirmation. That is more than a clean LGTM. CI
Inline commentsNone posted. All substantive points (custom-client dispose, <26 Disconnect redundancy, public-API break/net11) already appear in the PR thread across comments 6, 7–8, 12, and 18 — re-posting would duplicate. Multi-model review (gpt-5.5 · opus-4.8 · opus-4.6 · gemini-3.1-pro). Comments only — not a formal approval. |
<!-- 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. Thank you! ## Summary - Recognizes the `MauiBot` account as the AI Summary author for `/review rerun` eligibility. - Replaces duplicated author regex checks with one allowlist helper used by AI Summary detection and bot-comment rejection. - Adds regression coverage based on dotnet#34426 comments 4239128463 and 4658057491. ## Validation - `Invoke-Pester .github/scripts/Resolve-RerunEligibility.Tests.ps1,.github/scripts/Invoke-RerunReviewTrigger.Tests.ps1 -CI` - `Resolve-RerunEligibility.ps1 -PRNumber 34426 -CurrentCommentId 4658995396` returned `Rerun eligibility: True (new-head-commit)` - Verified the patched helper selects AI Summary comment `4239128463` authored by `MauiBot`. ## Fixes - Follow-up to dotnet#35685 --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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 from this PR and let us know in a comment if this change resolves your issue. Thank you!
Root Cause
The MAUI handler lifecycle calls
ConnectHandlerbefore the property mappers run. When a developer sets a customWebViewClientinConnectHandler, the subsequent execution ofMapWebViewClient(triggered by the mapper pipeline) would callplatformView.SetWebViewClient(new MauiWebViewClient(...)), silently discarding the custom client. SinceMapWebViewClientandMapWebChromeClientserve no purpose beyond initial setup — they are not responding to any virtual view property change — registering them in the mapper was incorrect. Moving client creation toCreatePlatformView()and removing them from the mapper pipeline ensures the default clients are set once, beforeConnectHandlerruns, allowing developers to override them reliably.Description of Change
On Android,
WebViewHandlerregisteredMapWebViewClientandMapWebChromeClientas property mapper entries. These mappers created newMauiWebViewClient/MauiWebChromeClientinstances and set them on the platform view every time they ran — afterConnectHandlerwas called. This meant any customWebViewClientset by users inConnectHandler(e.g., to intercept navigation viaShouldOverrideUrlLoading) would be silently replaced by MAUI's default client.Changes:
MapWebViewClientandMapWebChromeClientmapper methods entirelyCreatePlatformView()and stored as private fields (_webViewClient,_webChromeClient)DisconnectHandleruses the stored field references directly forDisconnect()andDispose(), rather than casting from the platform viewWebViewClientinConnectHandlerwithout MAUI replacing itIssues Fixed
Fixes #34392