Skip to content

[WIP][Android] Fix for Unable to Programmatically Update SearchHandler Query Value on Second Tab within ShellSection#29715

Draft
SyedAbdulAzeemSF4852 wants to merge 7 commits intodotnet:mainfrom
SyedAbdulAzeemSF4852:fix-29570
Draft

[WIP][Android] Fix for Unable to Programmatically Update SearchHandler Query Value on Second Tab within ShellSection#29715
SyedAbdulAzeemSF4852 wants to merge 7 commits intodotnet:mainfrom
SyedAbdulAzeemSF4852:fix-29570

Conversation

@SyedAbdulAzeemSF4852
Copy link
Copy Markdown
Contributor

@SyedAbdulAzeemSF4852 SyedAbdulAzeemSF4852 commented May 28, 2025

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!

Issue Details

  • Unable to Programmatically Update SearchHandler Query Value on Second Tab within ShellSection.

Root Cause

  • When navigating to the second tab, the previous search handler remains attached to the SearchView, and the new handler is not being applied.

Description of Change

  • Introduced a new method RemoveSearchView to encapsulate the logic for cleaning up _searchView, replacing direct inline removal calls in multiple methods (Dispose, OnPageChanged, UpdateToolbarItems). This improves code readability and reduces duplication.
  • Also ensured that the old SearchView is properly cleared, and a new one is created with the updated search handler upon page change.

Issues Fixed

Fixes #29570
Fixes #8716

Validated the behaviour in the following platforms

  • Windows
  • Android
  • iOS
  • Mac

Output

Before After
Before.mov
After.mov

@dotnet-policy-service dotnet-policy-service bot added community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration labels May 28, 2025
@jsuarezruiz jsuarezruiz added platform/android area-controls-shell Shell Navigation, Routes, Tabs, Flyout labels May 29, 2025
@jsuarezruiz
Copy link
Copy Markdown
Contributor

/azp run MAUI-UITests-public

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

public void VerifySearchQueryUpdateOnSecondShellTab()
{
#if WINDOWS
// App.Tap("navViewItem");
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.

Can uncomment this, with the compilation directive from line 1 will not run on Windows.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@jsuarezruiz , Thanks for the suggestion. I have removed the Windows-specific test case, as the test logic is now restricted to Windows.

@SyedAbdulAzeemSF4852 SyedAbdulAzeemSF4852 marked this pull request as ready for review May 29, 2025 12:41
@SyedAbdulAzeemSF4852 SyedAbdulAzeemSF4852 requested a review from a team as a code owner May 29, 2025 12:41
@jsuarezruiz
Copy link
Copy Markdown
Contributor

/azp run MAUI-UITests-public

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).


[Test]
[Category(UITestCategories.Shell)]
public void VerifySearchQueryUpdateOnSecondShellTab()
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.

Failing test on Windows:

Assert.That(searchHandlerString, Is.EqualTo("Hound"))
Expected string length 5 but was 0. Strings differ at index 0.
Expected: "Hound"
But was:  <string.Empty>
-----------^

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@jsuarezruiz , This test case will pass once the PR is merged into main (it has already been merged into the inflight branch).

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.

#29441 is already merged. Triggered a new build.

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.

Sorry, keep failing with the same:

Assert.That(searchHandlerString, Is.EqualTo("Hound"))
Expected string length 5 but was 0. Strings differ at index 0.
Expected: "Hound"
But was:  <string.Empty>
-----------^

After rebase and trigger another build. Could you take a look?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@jsuarezruiz , The PR was initially merged only into the inflight branch, which is why the test case was still failing. Now that it's merged into main, the test case will pass on the Windows platform in the next run.

@jsuarezruiz
Copy link
Copy Markdown
Contributor

/rebase

@jsuarezruiz
Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 3 pipeline(s).


[Test]
[Category(UITestCategories.Shell)]
public void VerifySearchQueryUpdateOnSecondShellTab()
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.

Sorry, keep failing with the same:

Assert.That(searchHandlerString, Is.EqualTo("Hound"))
Expected string length 5 but was 0. Strings differ at index 0.
Expected: "Hound"
But was:  <string.Empty>
-----------^

After rebase and trigger another build. Could you take a look?

@MauiBot
Copy link
Copy Markdown
Collaborator

MauiBot commented Mar 21, 2026

🤖 AI Summary

📊 Expand Full Reviewdc93dc9 · Added the Windows-specific test case, as the test logic is no longer restricted to Windows
🔍 Pre-Flight — Context & Validation

Issue: #29570 - Unable to Programmatically Update SearchHandler Query Value on Second Tab within ShellSection
Issue 2: #8716 - [Shell][Android] Top tab search handlers use wrong handler
PR: #29715 - [WIP][Android] Fix for Unable to Programmatically Update SearchHandler Query Value on Second Tab within ShellSection
Platforms Affected: Android (primary)
Files Changed: 1 implementation (ShellToolbarTracker.cs), 2 test (Issue29570.cs HostApp + SharedTests)

Key Findings

  • Root cause is two-part:
    1. Handler swap bug: When navigating to a second tab, the old _searchView (bound to the first tab's SearchHandler) remains attached. PR's fix addresses this by checking in OnPageChanged if _searchView.SearchHandler != newPage's SearchHandler and calling RemoveSearchView(_searchView) + null to force recreation.
    2. Programmatic query update bug (NOT fixed by PR): ShellSearchView.OnSearchHandlerPropertyChanged only handles IsSearchEnabled. When searchHandler.Query is set programmatically, the property change fires but _textBlock.Text is never updated — so the SearchView UI never reflects the new value.
  • Gate FAILED: Even with the PR's fix, the test fails — searchHandlerString is "" instead of "Hound". This confirms the second root cause is present and unaddressed.
  • Test issues:
    • CatsPageUpdateQueryBtn in Issue29570CatsPage has no click handler — it never updates the SearchHandler query on tab 1.
    • The test only exercises DogsPage (tab 2), which is the correct path for this bug.
    • Test uses App.GetShellSearchHandler().GetText() to verify — this relies on the SearchView's native text field being updated.
  • Reviewer (jsuarezruiz) notes: Observed searchHandlerString == "" on Windows too. Contributor attributed Windows failures to PR [Windows] Fix for SearchHandler Visibility Not Updating During In-Section Navigation #29441 not being merged (now merged), but that is a separate issue — the core Android bug (missing QueryProperty handler in ShellSearchView) is still unaddressed.
  • PR status: Still [WIP] / draft.

Fix Candidates

# Source Approach Test Result Files Changed Notes
PR PR #29715 Remove _searchView in OnPageChanged when handler changes; extract RemoveSearchView() helper ❌ FAIL (Gate) ShellToolbarTracker.cs Fixes handler swap but NOT programmatic Query→UI sync

🔧 Fix — Analysis & Comparison

Fix Candidates

# Source Approach Test Result Files Changed Notes
PR PR #29715 Remove _searchView in OnPageChanged when handler changes; extract RemoveSearchView() helper ❌ FAIL (Gate) ShellToolbarTracker.cs Fixes handler swap (Part 1) but NOT programmatic Query→UI sync (Part 2)
1 try-fix (claude-opus) Add QueryProperty branch in ShellSearchView.OnSearchHandlerPropertyChanged with if (_textBlock.Text != SearchHandler.Query) equality guard ✅ PASS 1 file (ShellSearchView.cs, +10 lines) Simplest fix; directly targets Part 2 root cause
2 try-fix (claude-sonnet) Smart SearchHandler property setter with RemoveTextChangedListener/AddTextChangedListener + in-place handler update in UpdateToolbarItems ✅ PASS 2 files (+42/-1 lines) More complex; over-engineers Part 1 beyond what PR already fixes
3 try-fix (gpt-codex) Tracker-level bridge: UpdateQueryFromTracker() method with _updatingQueryFromTracker flag guard in ShellSearchView; tracker subscribes ✅ PASS 2 files Adds indirection; flag guard is heavier than equality check
4 try-fix (gpt-5.4) Tracker-driven recreation: recreate search view when SearchHandler differs or Query is out of sync in UpdateToolbarItems ✅ PASS 1 file (ShellToolbarTracker.cs) Recreation is heavier than needed for a simple text sync

Cross-Pollination

Model Round New Ideas? Details
claude-opus 2 NO NEW IDEAS Space fully covered by 4 natural intervention points
claude-sonnet 2 YES OnAttachedToWindow sync — not complete (doesn't handle post-attach programmatic updates)
gpt-codex 2 YES Per-tab/per-SearchHandler caching — major architectural change, not suitable for focused fix
gpt-5.4 2 YES Per-tab isolation — same as gpt-codex suggestion, architectural change

Exhausted: Yes — no new viable ideas beyond the 4 tested approaches

Selected Fix: PR's fix (Part 1) + Candidate #1 (Part 2) — together they form the complete fix

Reason: Candidate #1 is the simplest possible complement to the PR's existing fix:

  • Single file change (+10 lines in ShellSearchView.cs)
  • Directly targets the exact root cause (missing QueryProperty handler)
  • Equality guard is sufficient and readable — no extra abstraction layers
  • The PR's ShellToolbarTracker.cs changes handle Part 1; Candidate [Draft] Readme WIP #1 handles Part 2
  • Follows existing code pattern in OnSearchHandlerPropertyChanged

📋 Report — Final Recommendation

⚠️ Final Recommendation: REQUEST CHANGES

Phase Status

Phase Status Notes
Pre-Flight ✅ COMPLETE Issue #29570 + #8716, Android, 1 impl file + 2 test files
Gate ❌ FAILED Android — test VerifySearchQueryUpdateOnSecondShellTab FAIL both without and with fix
Try-Fix ✅ COMPLETE 4 attempts, 4 passing; best complement selected
Report ✅ COMPLETE

Summary

The PR's fix is incomplete. It correctly addresses Part 1 (handler swap when switching tabs) by removing the stale _searchView in OnPageChanged, but it does not address Part 2: when searchHandler.Query is set programmatically, the native Android _textBlock.Text never updates because ShellSearchView.OnSearchHandlerPropertyChanged only handles IsSearchEnabled and ignores QueryProperty changes. This is confirmed by the Gate failure — even with the PR applied, searchHandlerString returns "" instead of "Hound".

Root Cause

Two-part root cause:

  1. Part 1 (fixed by PR): On tab navigation, the old _searchView (bound to the previous page's SearchHandler) stays attached. PR correctly removes it in OnPageChanged when _searchView.SearchHandler != newPage's SearchHandler.
  2. Part 2 (NOT fixed by PR): ShellSearchView.OnSearchHandlerPropertyChanged (line 237) only handles IsSearchEnabled. When searchHandler.Query = "Hound" is set programmatically, PropertyChanged fires but there is no case for SearchHandler.QueryProperty — so _textBlock.Text is never updated and App.GetShellSearchHandler().GetText() returns "".

Fix Quality

The PR's ShellToolbarTracker.cs changes (Part 1) are clean and correct — extracting RemoveSearchView() reduces duplication and the OnPageChanged guard is logical. However, the fix is incomplete without also handling QueryProperty in ShellSearchView.

Recommended additional change (found by Try-Fix Attempt 1 ✅):

In ShellSearchView.OnSearchHandlerPropertyChanged (file: src/Controls/src/Core/Compatibility/Handlers/Shell/Android/ShellSearchView.cs), add:

else if (e.PropertyName == SearchHandler.QueryProperty.PropertyName)
{
    // Update the native text field when Query is set programmatically.
    // The equality check prevents a circular update loop:
    // _textBlock.Text change → AfterTextChanged → SetValue(Query) → PropertyChanged → here
    if (_textBlock.Text != SearchHandler.Query)
    {
        _textBlock.Text = SearchHandler.Query;
    }
}

This is the minimal, targeted fix: 10 lines in a single additional file, directly addressing the missing property handler with a simple equality guard to prevent circular updates.

Additional test issues to fix:

  • Issue29570CatsPage.CatsPageUpdateQueryBtn has no click handler — clicking it does nothing. Either add a handler that sets searchHandler.Query (to make the test exercise CatsPage too) or document that this button is intentionally inert.
  • The [WIP] / draft status should be removed when the fix is complete.

@MauiBot MauiBot added s/agent-review-incomplete AI agent could not complete all phases (blocker, timeout, error) s/agent-reviewed PR was reviewed by AI agent workflow (full 4-phase review) and removed s/agent-review-incomplete AI agent could not complete all phases (blocker, timeout, error) labels Mar 21, 2026
@MauiBot MauiBot added s/agent-changes-requested AI agent recommends changes - found a better alternative or issues s/agent-fix-win AI found a better alternative fix than the PR labels Mar 21, 2026
Copy link
Copy Markdown
Contributor

@kubaflo kubaflo left a comment

Choose a reason for hiding this comment

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

Could you please review the AI's summary?

Copy link
Copy Markdown
Contributor

@kubaflo kubaflo left a comment

Choose a reason for hiding this comment

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

Looks like the test is failing

@SyedAbdulAzeemSF4852 SyedAbdulAzeemSF4852 marked this pull request as draft March 27, 2026 13:27
@SyedAbdulAzeemSF4852 SyedAbdulAzeemSF4852 changed the title [Android] Fix for Unable to Programmatically Update SearchHandler Query Value on Second Tab within ShellSection [WIP][Android] Fix for Unable to Programmatically Update SearchHandler Query Value on Second Tab within ShellSection Mar 27, 2026
@MauiBot MauiBot added s/agent-review-incomplete AI agent could not complete all phases (blocker, timeout, error) s/agent-changes-requested AI agent recommends changes - found a better alternative or issues and removed s/agent-changes-requested AI agent recommends changes - found a better alternative or issues s/agent-review-incomplete AI agent could not complete all phases (blocker, timeout, error) labels Mar 29, 2026
@dotnet dotnet deleted a comment from MauiBot Apr 3, 2026
@MauiBot
Copy link
Copy Markdown
Collaborator

MauiBot commented Apr 3, 2026

🚦 Gate - Test Before and After Fix

📊 Expand Full Gatedc93dc9 · Added the Windows-specific test case, as the test logic is no longer restricted to Windows

Gate Result: ❌ FAILED

Platform: ANDROID · Base: main · Merge base: 794a9fa6

Test Without Fix (expect FAIL) With Fix (expect PASS)
🖥️ Issue29570 Issue29570 ✅ FAIL — 981s ❌ FAIL — 805s
🔴 Without fix — 🖥️ Issue29570: FAIL ✅ · 981s

(truncated to last 15,000 chars)

/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.13735706
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13735706
  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.13735706
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13735706
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13735706
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13735706
  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.Xaml -> /home/vsts/work/1/s/artifacts/bin/Controls.Xaml/Debug/net10.0-android36.0/Microsoft.Maui.Controls.Xaml.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.13735706
  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.13735706
  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.13735706
  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.13735706
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13735706
  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.13735706
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13735706
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13735706
  Controls.Foldable -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.Controls.Foldable.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.Xaml -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.Controls.Xaml.dll
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13735706
  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:36.00
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/TestUtils/src/VisualTestUtils/VisualTestUtils.csproj (in 969 ms).
  Restored /home/vsts/work/1/s/src/TestUtils/src/UITest.NUnit/UITest.NUnit.csproj (in 879 ms).
  Restored /home/vsts/work/1/s/src/TestUtils/src/UITest.Core/UITest.Core.csproj (in 3 ms).
  Restored /home/vsts/work/1/s/src/TestUtils/src/VisualTestUtils.MagickNet/VisualTestUtils.MagickNet.csproj (in 7.15 sec).
  Restored /home/vsts/work/1/s/src/Controls/tests/CustomAttributes/Controls.CustomAttributes.csproj (in 7 ms).
  Restored /home/vsts/work/1/s/src/TestUtils/src/UITest.Appium/UITest.Appium.csproj (in 12 ms).
  Restored /home/vsts/work/1/s/src/Controls/tests/TestCases.Android.Tests/Controls.TestCases.Android.Tests.csproj (in 5.19 sec).
  Restored /home/vsts/work/1/s/src/TestUtils/src/UITest.Analyzers/UITest.Analyzers.csproj (in 3.09 sec).
  5 of 13 projects are up-to-date for restore.
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13735706
  Graphics -> /home/vsts/work/1/s/artifacts/bin/Graphics/Debug/net10.0/Microsoft.Maui.Graphics.dll
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13735706
  Controls.CustomAttributes -> /home/vsts/work/1/s/artifacts/bin/Controls.CustomAttributes/Debug/net10.0/Controls.CustomAttributes.dll
  Essentials -> /home/vsts/work/1/s/artifacts/bin/Essentials/Debug/net10.0/Microsoft.Maui.Essentials.dll
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13735706
  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.13735706
  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
  UITest.NUnit -> /home/vsts/work/1/s/artifacts/bin/UITest.NUnit/Debug/net10.0/UITest.NUnit.dll
  VisualTestUtils -> /home/vsts/work/1/s/artifacts/bin/VisualTestUtils/Debug/netstandard2.0/VisualTestUtils.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.15]   Discovering: Controls.TestCases.Android.Tests
[xUnit.net 00:00:00.45]   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
�[38;5;111m[969f0210]�[0m�[38;5;160m[Logcat]�[0m Logcat terminated with code 1, signal null
�[38;5;105m[544f71e5]�[0m�[38;5;160m[Logcat]�[0m Logcat terminated with code 1, signal null
�[38;5;191m[f4628a6f]�[0m�[38;5;160m[Logcat]�[0m Logcat terminated with code 1, signal null
�[38;5;202m[08ef2f12]�[0m�[38;5;160m[Logcat]�[0m Logcat terminated with code 1, signal null
�[38;5;24m[f6fe8f8e]�[0m�[38;5;160m[Logcat]�[0m Logcat terminated with code 1, signal null
�[38;5;217m[5934e425]�[0m�[38;5;160m[Logcat]�[0m Logcat terminated with code 1, signal null
�[38;5;210m[7b9a56fb]�[0m�[38;5;160m[Logcat]�[0m Logcat terminated with code 1, signal null
�[38;5;213m[98c360c1]�[0m�[38;5;160m[Logcat]�[0m Logcat terminated with code 1, signal null
�[38;5;30m[1a8f13b8]�[0m�[38;5;160m[Logcat]�[0m Logcat terminated with code 1, signal null
>>>>> 04/03/2026 11:26:59 The SaveDeviceDiagnosticInfo threw an exception during Issue29570(Android).
Exception details: System.InvalidOperationException: Call InitialSetup before accessing the App property.
   at UITest.Appium.NUnit.UITestContextBase.get_App() in /_/src/TestUtils/src/UITest.NUnit/UITestContextBase.cs:line 32
   at UITest.Appium.NUnit.UITestBase.SaveDeviceDiagnosticInfo(String note, Boolean storeForReattachment) in /_/src/TestUtils/src/UITest.NUnit/UITestBase.cs:line 255
TearDown failed for test fixture Microsoft.Maui.TestCases.Tests.Issues.Issue29570(Android)
OpenQA.Selenium.UnknownErrorException : An unknown server-side error occurred while processing the command. Original error: Error executing adbExec. Original error: 'Command '/usr/local/lib/android/sdk/platform-tools/adb -P 5037 -s emulator-5554 install -r --no-incremental /home/vsts/work/1/s/.appium/node_modules/appium-uiautomator2-driver/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-v7.4.1.apk' timed out after 20000ms'. Try to increase the 20000ms adb execution timeout represented by 'uiautomator2ServerInstallTimeout' capability
TearDown : System.InvalidOperationException : Call InitialSetup before accessing the App property.
StackTrace:    at OpenQA.Selenium.WebDriver.UnpackAndThrowOnError(Response errorResponse, String commandToExecute)
   at OpenQA.Selenium.WebDriver.ExecuteAsync(String driverCommandToExecute, Dictionary`2 parameters)
   at OpenQA.Selenium.WebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
   at OpenQA.Selenium.Appium.AppiumDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
   at OpenQA.Selenium.WebDriver.StartSession(ICapabilities capabilities)
   at OpenQA.Selenium.WebDriver..ctor(ICommandExecutor executor, ICapabilities capabilities)
   at OpenQA.Selenium.Appium.AppiumDriver..ctor(ICommandExecutor commandExecutor, ICapabilities appiumOptions)
   at OpenQA.Selenium.Appium.AppiumDriver..ctor(Uri remoteAddress, ICapabilities appiumOptions, TimeSpan commandTimeout, AppiumClientConfig clientConfig)
   at OpenQA.Selenium.Appium.AppiumDriver..ctor(Uri remoteAddress, ICapabilities appiumOptions, TimeSpan commandTimeout)
   at OpenQA.Selenium.Appium.AppiumDriver..ctor(Uri remoteAddress, ICapabilities appiumOptions)
   at OpenQA.Selenium.Appium.Android.AndroidDriver..ctor(Uri remoteAddress, DriverOptions driverOptions)
   at UITest.Appium.AppiumAndroidApp..ctor(Uri remoteAddress, IConfig config) in /_/src/TestUtils/src/UITest.Appium/AppiumAndroidApp.cs:line 11
   at UITest.Appium.AppiumAndroidApp.CreateAndroidApp(Uri remoteAddress, IConfig config) in /_/src/TestUtils/src/UITest.Appium/AppiumAndroidApp.cs:line 41
   at UITest.Appium.AppiumServerContext.CreateUIClientContext(IConfig config) in /_/src/TestUtils/src/UITest.Appium/AppiumServerContext.cs:line 42
   at UITest.Appium.NUnit.UITestContextBase.InitialSetup(IServerContext context, Boolean reset) in /_/src/TestUtils/src/UITest.NUnit/UITestContextBase.cs:line 77
   at UITest.Appium.NUnit.UITestContextBase.InitialSetup(IServerContext context) in /_/src/TestUtils/src/UITest.NUnit/UITestContextBase.cs:line 55
   at UITest.Appium.NUnit.UITestBase.OneTimeSetup() in /_/src/TestUtils/src/UITest.NUnit/UITestBase.cs:line 215
   at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args)
   at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
--TearDown
   at UITest.Appium.NUnit.UITestContextBase.get_App() in /_/src/TestUtils/src/UITest.NUnit/UITestContextBase.cs:line 32
   at UITest.Appium.NUnit.UITestBase.OneTimeTearDown() in /_/src/TestUtils/src/UITest.NUnit/UITestBase.cs:line 244
   at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args)
   at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
NUnit Adapter 4.5.0.0: Test execution complete
  Failed VerifySearchQueryUpdateOnSecondShellTab [4 m 31 s]
  Error Message:
   OneTimeSetUp: OpenQA.Selenium.UnknownErrorException : An unknown server-side error occurred while processing the command. Original error: Error executing adbExec. Original error: 'Command '/usr/local/lib/android/sdk/platform-tools/adb -P 5037 -s emulator-5554 install -r --no-incremental /home/vsts/work/1/s/.appium/node_modules/appium-uiautomator2-driver/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-v7.4.1.apk' timed out after 20000ms'. Try to increase the 20000ms adb execution timeout represented by 'uiautomator2ServerInstallTimeout' capability
  Stack Trace:
     at OpenQA.Selenium.WebDriver.UnpackAndThrowOnError(Response errorResponse, String commandToExecute)
   at OpenQA.Selenium.WebDriver.ExecuteAsync(String driverCommandToExecute, Dictionary`2 parameters)
   at OpenQA.Selenium.WebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
   at OpenQA.Selenium.Appium.AppiumDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
   at OpenQA.Selenium.WebDriver.StartSession(ICapabilities capabilities)
   at OpenQA.Selenium.WebDriver..ctor(ICommandExecutor executor, ICapabilities capabilities)
   at OpenQA.Selenium.Appium.AppiumDriver..ctor(ICommandExecutor commandExecutor, ICapabilities appiumOptions)
   at OpenQA.Selenium.Appium.AppiumDriver..ctor(Uri remoteAddress, ICapabilities appiumOptions, TimeSpan commandTimeout, AppiumClientConfig clientConfig)
   at OpenQA.Selenium.Appium.AppiumDriver..ctor(Uri remoteAddress, ICapabilities appiumOptions, TimeSpan commandTimeout)
   at OpenQA.Selenium.Appium.AppiumDriver..ctor(Uri remoteAddress, ICapabilities appiumOptions)
   at OpenQA.Selenium.Appium.Android.AndroidDriver..ctor(Uri remoteAddress, DriverOptions driverOptions)
   at UITest.Appium.AppiumAndroidApp..ctor(Uri remoteAddress, IConfig config) in /_/src/TestUtils/src/UITest.Appium/AppiumAndroidApp.cs:line 11
   at UITest.Appium.AppiumAndroidApp.CreateAndroidApp(Uri remoteAddress, IConfig config) in /_/src/TestUtils/src/UITest.Appium/AppiumAndroidApp.cs:line 41
   at UITest.Appium.AppiumServerContext.CreateUIClientContext(IConfig config) in /_/src/TestUtils/src/UITest.Appium/AppiumServerContext.cs:line 42
   at UITest.Appium.NUnit.UITestContextBase.InitialSetup(IServerContext context, Boolean reset) in /_/src/TestUtils/src/UITest.NUnit/UITestContextBase.cs:line 77
   at UITest.Appium.NUnit.UITestContextBase.InitialSetup(IServerContext context) in /_/src/TestUtils/src/UITest.NUnit/UITestContextBase.cs:line 55
   at UITest.Appium.NUnit.UITestBase.OneTimeSetup() in /_/src/TestUtils/src/UITest.NUnit/UITestBase.cs:line 215
   at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args)
   at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)


Total tests: 1
     Failed: 1
Test Run Failed.
 Total time: 4.6695 Minutes

🟢 With fix — 🖥️ Issue29570: FAIL ❌ · 805s
  Determining projects to restore...
  All projects are up-to-date for restore.
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13735706
  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.13735706
  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.13735706
  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.13735706
  Maps -> /home/vsts/work/1/s/artifacts/bin/Maps/Debug/net10.0-android36.0/Microsoft.Maui.Maps.dll
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13735706
  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.13735706
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13735706
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13735706
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13735706
  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.13735706
  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.13735706
  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.13735706
  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.13735706
  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.13735706
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13735706
  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.13735706
  Maps -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.Maps.dll
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13735706
  Controls.Maps -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.Controls.Maps.dll
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13735706
  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:10:37.95
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.13735706
  Graphics -> /home/vsts/work/1/s/artifacts/bin/Graphics/Debug/net10.0/Microsoft.Maui.Graphics.dll
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13735706
  Essentials -> /home/vsts/work/1/s/artifacts/bin/Essentials/Debug/net10.0/Microsoft.Maui.Essentials.dll
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13735706
  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.13735706
  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
  UITest.NUnit -> /home/vsts/work/1/s/artifacts/bin/UITest.NUnit/Debug/net10.0/UITest.NUnit.dll
  VisualTestUtils -> /home/vsts/work/1/s/artifacts/bin/VisualTestUtils/Debug/netstandard2.0/VisualTestUtils.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.35]   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/03/2026 11:40:07 FixtureSetup for Issue29570(Android)
>>>>> 04/03/2026 11:40:10 VerifySearchQueryUpdateOnSecondShellTab Start
>>>>> 04/03/2026 11:40:15 VerifySearchQueryUpdateOnSecondShellTab Stop
>>>>> 04/03/2026 11:40:15 Log types: logcat, bugreport, server
  Failed VerifySearchQueryUpdateOnSecondShellTab [6 s]
  Error Message:
     Assert.That(searchHandlerString, Is.EqualTo("Hound"))
  Expected string length 5 but was 16. Strings differ at index 0.
  Expected: "Hound"
  But was:  "Enter dog's name"
  -----------^

  Stack Trace:
     at Microsoft.Maui.TestCases.Tests.Issues.Issue29570.VerifySearchQueryUpdateOnSecondShellTab() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue29570.cs:line 30

1)    at Microsoft.Maui.TestCases.Tests.Issues.Issue29570.VerifySearchQueryUpdateOnSecondShellTab() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue29570.cs:line 30


NUnit Adapter 4.5.0.0: Test execution complete

Total tests: 1
     Failed: 1
Test Run Failed.
 Total time: 31.5464 Seconds

⚠️ Issues found
  • Issue29570 FAILED with fix (should pass)
    • VerifySearchQueryUpdateOnSecondShellTab [6 s]
    • Assert.That(searchHandlerString, Is.EqualTo("Hound")) Expected string length 5 but was 16. Strings differ at index 0. Expected: "Hound" But was: "Enter dog's name" -----------^
📁 Fix files reverted (2 files)
  • eng/pipelines/ci-copilot.yml
  • src/Controls/src/Core/Compatibility/Handlers/Shell/Android/ShellToolbarTracker.cs

@MauiBot MauiBot added s/agent-fix-pr-picked AI could not beat the PR fix - PR is the best among all candidates and removed s/agent-fix-win AI found a better alternative fix than the PR labels Apr 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-controls-shell Shell Navigation, Routes, Tabs, Flyout community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration platform/android s/agent-changes-requested AI agent recommends changes - found a better alternative or issues s/agent-fix-pr-picked AI could not beat the PR fix - PR is the best among all candidates s/agent-reviewed PR was reviewed by AI agent workflow (full 4-phase review)

Projects

None yet

6 participants