Fix for TabBar Navigation does not invoke its IQueryAttributable.ApplyQueryAttributes(query)#25663
Conversation
|
Hey there @SuthiYuvaraj! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
/rebase |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
jsuarezruiz
left a comment
There was a problem hiding this comment.
There are unit tests failing:
Failed InitialNavigationDoesntSetQueryAttributesProperty [< 1 ms]
Error Message:
Assert.False() Failure
Expected: False
Actual: True
Failed SetCurrentItemAddsToShellCollection [1 ms]
Error Message:
System.NullReferenceException : Object reference not set to an instance of an object.
Stack Trace:
at Microsoft.Maui.Controls.Shell.Microsoft.Maui.Controls.IShellController.UpdateCurrentState(ShellNavigationSource source) in /_/src/Controls/src/Core/Shell/Shell.cs:line 936
at Microsoft.Maui.Controls.ShellNavigationManager.GoToAsync(ShellNavigationParameters shellNavigationParameters, ShellNavigationRequest navigationRequest) in /_/src/Controls/src/Core/Shell/ShellNavigationManager.cs:line 204
at Microsoft.Maui.Controls.Shell.<Initialize>g__SetCurrentItem|158_1() in /_/src/Controls/src/Core/Shell/Shell.cs:line 1284
at Microsoft.Maui.Controls.Shell.<Initialize>b__158_0(Object s, NotifyCollectionChangedEventArgs e) in /_/src/Controls/src/Core/Shell/Shell.cs:line 1217
at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__128_0(Object state)
Hi @jsuarezruiz , The |
|
/azp run |
This comment was marked as outdated.
This comment was marked as outdated.
jsuarezruiz
left a comment
There was a problem hiding this comment.
Sorry, still there is one failing unit tests:
Failed InitialNavigationDoesntSetQueryAttributesProperty [< 1 ms]
Error Message:
Assert.False() Failure
Expected: False
Actual: True
@jsuarezruiz, The failing unit test case is intended to verify that the query attribute should not be present during the initial loading. However, the bug report confirms this behavior as a valid bug #13537 (comment), the test case is no longer applicable. Can the failing test case be removed? |
@jsuarezruiz , After analyzing the failed test case ( |
This comment was marked as outdated.
This comment was marked as outdated.
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
when merged, merge additional tests from #33006 |
…yQueryAttributes(query) (#25663) * Fix - 13573 fix changes * Testcases commit * Update Shell.cs * commit for testcases * commit for review changes * Commit for class name changes * Commit class name change * Commit for review * commit for testcase changes * Commit for images * Test case changes * Update Issue13537.cs * Update Issue13537.cs * Update Issue13537.cs * Update Shell.cs * Update Shell.cs * changes for initial triggering * comments updated * Update Issue13537.cs * Update Issue13537.cs commit testcase failure * Changes for indentation * Review changes * Update Issue13537.cs
…yQueryAttributes(query) (#25663) * Fix - 13573 fix changes * Testcases commit * Update Shell.cs * commit for testcases * commit for review changes * Commit for class name changes * Commit class name change * Commit for review * commit for testcase changes * Commit for images * Test case changes * Update Issue13537.cs * Update Issue13537.cs * Update Issue13537.cs * Update Shell.cs * Update Shell.cs * changes for initial triggering * comments updated * Update Issue13537.cs * Update Issue13537.cs commit testcase failure * Changes for indentation * Review changes * Update Issue13537.cs
…yQueryAttributes(query) (#25663) * Fix - 13573 fix changes * Testcases commit * Update Shell.cs * commit for testcases * commit for review changes * Commit for class name changes * Commit class name change * Commit for review * commit for testcase changes * Commit for images * Test case changes * Update Issue13537.cs * Update Issue13537.cs * Update Issue13537.cs * Update Shell.cs * Update Shell.cs * changes for initial triggering * comments updated * Update Issue13537.cs * Update Issue13537.cs commit testcase failure * Changes for indentation * Review changes * Update Issue13537.cs
…yQueryAttributes(query) (#25663) * Fix - 13573 fix changes * Testcases commit * Update Shell.cs * commit for testcases * commit for review changes * Commit for class name changes * Commit class name change * Commit for review * commit for testcase changes * Commit for images * Test case changes * Update Issue13537.cs * Update Issue13537.cs * Update Issue13537.cs * Update Shell.cs * Update Shell.cs * changes for initial triggering * comments updated * Update Issue13537.cs * Update Issue13537.cs commit testcase failure * Changes for indentation * Review changes * Update Issue13537.cs
…yQueryAttributes(query) (#25663) * Fix - 13573 fix changes * Testcases commit * Update Shell.cs * commit for testcases * commit for review changes * Commit for class name changes * Commit class name change * Commit for review * commit for testcase changes * Commit for images * Test case changes * Update Issue13537.cs * Update Issue13537.cs * Update Issue13537.cs * Update Shell.cs * Update Shell.cs * changes for initial triggering * comments updated * Update Issue13537.cs * Update Issue13537.cs commit testcase failure * Changes for indentation * Review changes * Update Issue13537.cs
…yQueryAttributes(query) (#25663) * Fix - 13573 fix changes * Testcases commit * Update Shell.cs * commit for testcases * commit for review changes * Commit for class name changes * Commit class name change * Commit for review * commit for testcase changes * Commit for images * Test case changes * Update Issue13537.cs * Update Issue13537.cs * Update Issue13537.cs * Update Shell.cs * Update Shell.cs * changes for initial triggering * comments updated * Update Issue13537.cs * Update Issue13537.cs commit testcase failure * Changes for indentation * Review changes * Update Issue13537.cs
…yQueryAttributes(query) (#25663) * Fix - 13573 fix changes * Testcases commit * Update Shell.cs * commit for testcases * commit for review changes * Commit for class name changes * Commit class name change * Commit for review * commit for testcase changes * Commit for images * Test case changes * Update Issue13537.cs * Update Issue13537.cs * Update Issue13537.cs * Update Shell.cs * Update Shell.cs * changes for initial triggering * comments updated * Update Issue13537.cs * Update Issue13537.cs commit testcase failure * Changes for indentation * Review changes * Update Issue13537.cs
…yQueryAttributes(query) (#25663) * Fix - 13573 fix changes * Testcases commit * Update Shell.cs * commit for testcases * commit for review changes * Commit for class name changes * Commit class name change * Commit for review * commit for testcase changes * Commit for images * Test case changes * Update Issue13537.cs * Update Issue13537.cs * Update Issue13537.cs * Update Shell.cs * Update Shell.cs * changes for initial triggering * comments updated * Update Issue13537.cs * Update Issue13537.cs commit testcase failure * Changes for indentation * Review changes * Update Issue13537.cs
…yQueryAttributes(query) (#25663) * Fix - 13573 fix changes * Testcases commit * Update Shell.cs * commit for testcases * commit for review changes * Commit for class name changes * Commit class name change * Commit for review * commit for testcase changes * Commit for images * Test case changes * Update Issue13537.cs * Update Issue13537.cs * Update Issue13537.cs * Update Shell.cs * Update Shell.cs * changes for initial triggering * comments updated * Update Issue13537.cs * Update Issue13537.cs commit testcase failure * Changes for indentation * Review changes * Update Issue13537.cs
## CollectionView - Fixed the NRE in CarouselViewController on iOS 15.5 & 16.4 by @Ahamed-Ali in #30838 <details> <summary>🔧 Fixes</summary> - [NRE in CarouselViewController on iOS 15.5 & 16.4](#28557) </details> - [iOS, macOS] Fixed CollectionView group header size changes with ItemSizingStrategy by @NanthiniMahalingam in #33161 <details> <summary>🔧 Fixes</summary> - [[NET 10] I6_Grouping - Grouping_with_variable_sized_items changing the 'ItemSizingStrategy' also changes the header size.](#33130) </details> ## Flyout - Add unit tests for TabBar and FlyoutItem navigation ApplyQueryAttributes (#25663) by @StephaneDelcroix in #33006 ## Flyoutpage - Fixed the FlyoutPage.Flyout Disappearing When Maximizing the Window on Mac Platform by @NanthiniMahalingam in #26701 <details> <summary>🔧 Fixes</summary> - [FlyoutPage.Flyout - navigation corrupted when running om mac , on window ok](#22719) </details> ## Mediapicker - [Windows] Fix for PickPhotosAsync throws exception if image is modified by @HarishwaranVijayakumar in #32952 <details> <summary>🔧 Fixes</summary> - [PickPhotosAsync throws exception if image is modified.](#32408) </details> ## Navigation - Fix for TabBar Navigation does not invoke its IQueryAttributable.ApplyQueryAttributes(query) by @SuthiYuvaraj in #25663 <details> <summary>🔧 Fixes</summary> - [Tabs defined in AppShell.xaml does not invoke its view model's IQueryAttributable.ApplyQueryAttributes(query) implementaion](#13537) - [`ShellContent` routes do not call `ApplyQueryAttributes`](#28453) </details> ## ScrollView - Fix ScrollToPosition.Center behavior in ScrollView on iOS and MacCatalyst by @devanathan-vaithiyanathan in #26825 <details> <summary>🔧 Fixes</summary> - [ScrollToPosition.Center Centers the First Item too in iOS and Catalyst](#26760) - [On iOS - ScrollView.ScrollToAsync Element, ScrollToPosition.MakeVisible shifts view to the right, instead of just scrolling vertically](#28965) </details> ## Searchbar - [iOS, Mac, Windows] Fixed CharacterSpacing for SearchBar text and placeholder text by @Dhivya-SF4094 in #30407 <details> <summary>🔧 Fixes</summary> - [[iOS, Mac, Windows] SearchBar CharacterSpacing property is not working as expected](#30366) </details> ## Shell - Update logic for large title display mode on iOS - shell by @kubaflo in #33039 ## TitleView - [iOS] Fixed memory leak with PopToRootAsync when using TitleView by @Vignesh-SF3580 in #28547 <details> <summary>🔧 Fixes</summary> - [NavigationPage.TitleView causes memory leak with PopToRootAsync](#28201) </details> ## Xaml - [C] Fix binding to interface-inherited properties like IReadOnlyList<T>.Count by @StephaneDelcroix in #32912 <details> <summary>🔧 Fixes</summary> - [Compiled Binding to Array.Count provides no result](#13872) </details> - Fix #31939: CommandParameter TemplateBinding lost during reparenting by @StephaneDelcroix in #32961 <details> <summary>🔧 Fixes</summary> - [CommandParameter TemplateBinding Lost During ControlTemplate Reparenting](#31939) </details> <details> <summary>🧪 Testing (4)</summary> - [Testing] Fixed Test case failure in PR 33185 - [12/22/2025] Candidate by @TamilarasanSF4853 in #33257 - [Testing] Re-saved ShouldFlyoutBeVisibleAfterMaximizingWindow test case images in PR 33185 - [12/22/2025] Candidate by @TamilarasanSF4853 in #33271 - [Testing] Fixed Test case failure in PR 33185 - [12/22/2025] Candidate - 2 by @TamilarasanSF4853 in #33299 - [Testing] Fixed Test case failure in PR 33185 - [12/22/2025] Candidate - 3 by @TamilarasanSF4853 in #33311 </details> <details> <summary>📦 Other (2)</summary> - [XSG][BindingSourceGen] Add support for RelayCommand to compiled bindings by @simonrozsival via @Copilot in #32954 <details> <summary>🔧 Fixes</summary> - [Issue #25818](#25818) </details> - Revert "Update logic for large title display mode on iOS - shell (#33039)" in cff7f35 </details> **Full Changelog**: main...inflight/candidate
Issue Details
While navigating between pages, ApplyQueryAttributes should trigger with data from the navigating page. In the current implementation, navigation using Push and GoToAsync works as expected, but other navigation methods do not trigger ApplyQueryAttributes notifications.
Root Cause
-GoToAsync Limitations: When navigating using PopAsync, PopModalAsync, back navigation, or between FlyoutPages, ApplyQueryAttributes is not triggered. This occurs because QueryAttributes is not correctly set for these navigation types.
-TabBar Navigation: Navigating between TabBar items changes the page by updating CurrentItemChanged. However, QueryAttributes is not updated for these item changes, leading to missing attribute notifications.
Fix Details
-GoToAsync Fix: Updated ShellNavigationManager to apply ApplyQueryAttributes when popping, ensuring QueryableAttributes values are set correctly.
-TabBar Navigation Fix: Invoked ApplyQueryAttributes within UpdateCurrentState to receive notifications for all ShellItem navigations, ensuring that QueryAttributes are updated consistently across TabBar item changes.
Issues Fixed
Fixes #13537
Fixes #28453
Output Screenshot