unoplatform / uno

Build Mobile, Desktop and WebAssembly apps with C# and XAML. Today. Open source and professionally supported.
https://platform.uno
Apache License 2.0
8.48k stars 690 forks source link

fix(droid): workaround for ItemsControl's ObjectDisposedException (backport #16631) #16739

Closed mergify[bot] closed 2 weeks ago

mergify[bot] commented 2 weeks ago

GitHub Issue (If applicable): (linked from private issue)

PR Type

What kind of change does this PR introduce?

What is the current behavior?

Leaked ItemsControl.ItemsSource subscription can cause ObjectDisposedException to be thrown when the said source is updated.

What is the new behavior?

The exception is prevented.

PR Checklist

Please check if your PR fulfills the following requirements:

Other information
This is an automatic backport of pull request #16631 done by Mergify.

unodevops commented 2 weeks ago

🤖 Your WebAssembly Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-16739/index.html

nventive-devops commented 2 weeks ago

The build 125178 found UI Test snapshots differences: android-28-net7: 20, android-28-net7-Snap: 43, ios: 3, ios-Snap: 27, skia-gtk-screenshots: 36, skia-linux-screenshots: 36, skia-windows-screenshots: 16, wasm: 62, wasm-automated-net7.0-UWP-Default-automated: 27, wasm-automated-net7.0-UWP-RuntimeTests-0: 0, wasm-automated-net7.0-UWP-RuntimeTests-1: 0, wasm-automated-net7.0-UWP-RuntimeTests-2: 0, wasm-automated-net7.0-WinUI-Benchmarks-automated: 0, wasm-automated-net7.0-WinUI-RuntimeTests-0: 0, wasm-automated-net7.0-WinUI-RuntimeTests-1: 0, wasm-automated-net7.0-WinUI-RuntimeTests-2: 0

Details * `android-28-net7`: **20** changed over 823
🚨🚨 Comparison Details (first 20) 🚨🚨 - `Detereminate_ProgressRing_Validation50_[#FF0000_#008000_#008000_#FF0000]_Progress-Ring-Value-50` - `ProgressRing_IsEnabled_Running_UITests_Windows_UI_Xaml_Controls_ProgressRing_WindowsProgressRing_GH1220` - `Detereminate_ProgressRing_Validation0_[#FF0000_#FF0000_#FF0000_#FF0000]_UITests_Microsoft_UI_Xaml_Controls_ProgressRing_WinUIDeterminateProgressRing` - `Detereminate_ProgressRing_Validation25_[#FF0000_#008000_#FF0000_#FF0000]_Progress-Ring-Value-25` - `UpDownEnabledTest_UITests_Shared_Microsoft_UI_Xaml_Controls_NumberBoxTests_NumberBoxPage` - `UpDownTest_UITests_Shared_Microsoft_UI_Xaml_Controls_NumberBoxTests_NumberBoxPage` - `When_InListView_after_scroll` - `When_MaxLines_Changed_On_Grid_Container_Uno_UI_Samples_Content_UITests_TextBlockControl_SimpleText_MaxLines_Multiple_Containers` - `When_MaxLines_Changed_On_Stack_Container_Uno_UI_Samples_Content_UITests_TextBlockControl_SimpleText_MaxLines_Multiple_Containers` - `ListView_SelectedItems_SamplesApp_Windows_UI_Xaml_Controls_ListView_ListViewSelectedItems` - `When_Parent_PointerMoved_After_drag_on_non-scrolling_ScrollViewer` - `When_InScrollViewer_after_scroll` - `When_Parent_PointerMoved_After_drag_on_ScrollViewer_-_touch` - `WebView_NavigateToLongString_AfterSuccess` - `DecimalFormatterTest_UITests_Shared_Microsoft_UI_Xaml_Controls_NumberBoxTests_NumberBoxPage` - `ProgressRing_Visibility_Collapsed_UITests_Windows_UI_Xaml_Controls_ProgressRing_WindowsProgressRing_GH1220` - `SequentialAnimations_SamplesApp_Windows_UI_Xaml_Media_Animation_SequentialAnimationsPage` - `NativeCommandBar_Size_Uno_UI_Samples_Content_UITests_CommandBar_CommandBar_Dynamic` - `Detereminate_ProgressRing_Validation75_[#FF0000_#008000_#008000_#008000]_Progress-Ring-Value-75` - `SelectionTest_UITests_Microsoft_UI_Xaml_Controls_RadioButtonsTests_RadioButtonsPage`
* `android-28-net7-Snap`: **43** changed over 1061
🚨🚨 Comparison Details (first 20) 🚨🚨 - `MediaPlayerElement_Using_mov_UITests_Shared_Windows_UI_Xaml_Controls_MediaPlayerElement_MediaPlayerElement_Mov_Extension` - `MediaPlayerElement_Using_mp3_Audio_only_UITests_Shared_Windows_UI_Xaml_Controls_MediaPlayerElement_MediaPlayerElement_Mp3_Extension` - `MediaPlayerElement_Using_ogg_UITests_Shared_Windows_UI_Xaml_Controls_MediaPlayerElement_MediaPlayerElement_Ogg_Extension` - `Default_SamplesApp_Wasm_Windows_UI_Xaml_Controls_ListView_ListView_IsSelected_SamplesApp_Wasm_Windows_UI_Xaml_Controls_ListView_ListView_IsSelected` - `MUX_NumberBox_UITests_Shared_Microsoft_UI_Xaml_Controls_NumberBoxTests_NumberBoxPage` - `Default_Uno_UI_Samples_Content_UITests_WebView_WebView_AnchorNavigation_Uno_UI_Samples_Content_UITests_WebView_WebView_AnchorNavigation` - `ListView_ListViewSelectedItems_SamplesApp_Windows_UI_Xaml_Controls_ListView_ListViewSelectedItems` - `MediaPlayerElement_MediaPlayerElement_Stretch_Fill_UITests_Shared_Windows_UI_Xaml_Controls_MediaPlayerElement_MediaPlayerElement_Stretch_Fill` - `Brushes_Uno_UI_Samples_UITests_ImageBrushTestControl_DoubleImageBrushInList_Uno_UI_Samples_UITests_ImageBrushTestControl_DoubleImageBrushInList` - `MediaPlayerElement_Mini_player_UITests_Shared_Windows_UI_Xaml_Controls_MediaPlayerElement_MediaPlayerElement_Minimal` - `Icons_UITests_Shared_Windows_UI_Xaml_Controls_BitmapIconTests_BitmapIcon_Foreground_UITests_Shared_Windows_UI_Xaml_Controls_BitmapIconTests_BitmapIcon_Foreground` - `TextBox_TextBox_TextAlignment_Uno_UI_Samples_Content_UITests_TextBoxControl_TextBox_TextAlignment` - `Scrolling_MUXControlsTestApp_ScrollViewWithScrollControllersPage_MUXControlsTestApp_ScrollViewWithScrollControllersPage` - `Windows_Media_MediaPlayer_UITests_Windows_Media_MediaPlayerTests` - `Brushes_Uno_UI_Samples_Samples_Shared_Content_UITests_ImageBrushInList_Uno_UI_Samples_Samples_Shared_Content_UITests_ImageBrushInList` - `WebView_UITests_Microsoft_UI_Xaml_Controls_WebView2Tests_WebView2_ExecuteScriptAsync_UITests_Microsoft_UI_Xaml_Controls_WebView2Tests_WebView2_ExecuteScriptAsync` - `Automation_UITests_Shared_Windows_UI_Xaml_Automation_AutomationProperties_Name_UITests_Shared_Windows_UI_Xaml_Automation_AutomationProperties_Name` - `Progress_UITests_Microsoft_UI_Xaml_Controls_ProgressRing_WinUIProgressRingPage_UITests_Microsoft_UI_Xaml_Controls_ProgressRing_WinUIProgressRingPage` - `TextBox_UITests_Shared_Windows_UI_Xaml_Controls_PasswordBoxTests_PasswordBoxPage_UITests_Shared_Windows_UI_Xaml_Controls_PasswordBoxTests_PasswordBoxPage` - `TextBox_UITests_Shared_Windows_UI_Xaml_Controls_TextBoxControl_TextBox_Binding_Null_UITests_Shared_Windows_UI_Xaml_Controls_TextBoxControl_TextBox_Binding_Null`
* `ios`: **3** changed over 265
🚨🚨 Comparison Details (first 20) 🚨🚨 - `ProgressRing_IsEnabled_Running_UITests_Windows_UI_Xaml_Controls_ProgressRing_WindowsProgressRing_GH1220` - `ProgressRing_Visibility_Collapsed_UITests_Windows_UI_Xaml_Controls_ProgressRing_WindowsProgressRing_GH1220` - `SequentialAnimations_SamplesApp_Windows_UI_Xaml_Media_Animation_SequentialAnimationsPage`
* `ios-Snap`: **27** changed over 1052
🚨🚨 Comparison Details (first 20) 🚨🚨 - `Default_Uno_UI_Samples_UITests_Image_Image_UseTargetSize_Uno_UI_Samples_UITests_Image_Image_UseTargetSize` - `Image_UITests_Shared_Windows_UI_Xaml_Controls_ImageTests_Image_Stretch_Alignment_SizeOnControl_UITests_Shared_Windows_UI_Xaml_Controls_ImageTests_Image_Stretch_Alignment_SizeOnControl` - `Progress_UITests_Microsoft_UI_Xaml_Controls_ProgressRing_WinUIProgressRingPage_UITests_Microsoft_UI_Xaml_Controls_ProgressRing_WinUIProgressRingPage` - `TextBlock_TextBlockMultilineInStarStackPanel_Uno_UI_Samples_Content_UITests_TextBlockControl_TextBlockMultilineInStarStackPanel` - `Brushes_Uno_UI_Samples_Samples_Shared_Content_UITests_ImageBrushInList_Uno_UI_Samples_Samples_Shared_Content_UITests_ImageBrushInList` - `Clipping_SamplesApp_Windows_UI_Xaml_Clipping_XamlButtonWithClipping_Scrollable_SamplesApp_Windows_UI_Xaml_Clipping_XamlButtonWithClipping_Scrollable` - `ListView_ListViewHeaderFooter_ImplicitlyBinded_SamplesApp_Windows_UI_Xaml_Controls_ListView_ListViewHeaderFooter_ImplicitlyBinded` - `Toolkit_UITests_Toolkit_ElevatedViewTests_UITests_Toolkit_ElevatedViewTests` - `Toolkit_UITests_Toolkit_ElevationView_Clipping_UITests_Toolkit_ElevationView_Clipping` - `UIElement_TransformToVisual_Simple_UITests_Shared_Windows_UI_Xaml_UIElementTests_TransformToVisual_Simple` - `Progress_UITests_Microsoft_UI_Xaml_Controls_ProgressRing_ProgressRingHeightTest_UITests_Microsoft_UI_Xaml_Controls_ProgressRing_ProgressRingHeightTest` - `Transform_Basics_UITests_Shared_Windows_UI_Xaml_Media_Transform_Basics` - `Brushes_PanelImageBrush_Uno_UI_Samples_UITests_ImageBrushTestControl_PanelImageBrush` - `Image_UITests_Windows_UI_Xaml_Controls_ImageTests_Image_Formats_UITests_Windows_UI_Xaml_Controls_ImageTests_Image_Formats` - `MediaPlayerElement_MediaPlayerElement_Stretch_Fill_UITests_Shared_Windows_UI_Xaml_Controls_MediaPlayerElement_MediaPlayerElement_Stretch_Fill` - `MediaPlayerElement_Mini_player_UITests_Shared_Windows_UI_Xaml_Controls_MediaPlayerElement_MediaPlayerElement_Minimal` - `WebView_UITests_Microsoft_UI_Xaml_Controls_WebView2Tests_WebView2_ExecuteScriptAsync_UITests_Microsoft_UI_Xaml_Controls_WebView2Tests_WebView2_ExecuteScriptAsync` - `WebView_UITests_Microsoft_UI_Xaml_Controls_WebView2Tests_WebView2_NavigationProperties_UITests_Microsoft_UI_Xaml_Controls_WebView2Tests_WebView2_NavigationProperties` - `WebView_UITests_Microsoft_UI_Xaml_Controls_WebViewTests_WebView_InvokeScriptAsync_UITests_Microsoft_UI_Xaml_Controls_WebViewTests_WebView_InvokeScriptAsync` - `Default_Uno_UI_Samples_Content_UITests_WebView_WebView_AnchorNavigation_Uno_UI_Samples_Content_UITests_WebView_WebView_AnchorNavigation`
* `skia-gtk-screenshots`: **36** changed over 2178
🚨🚨 Comparison Details (first 20) 🚨🚨 - `LargeImageList.png-dark` - `LargeImageList.png` - `DoubleImageBrushInList.png` - `Using .avi.png-dark` - `Using .avi.png` - `DoubleImageBrushInList.png-dark` - `WinUIProgressRingPage.png-dark` - `WinUIProgressRingPage.png` - `RectanglemaskingRectangleGrid.png` - `ImageSourceUrlMsAppDataScheme.png-dark` - `ImageSourceUrlMsAppDataScheme.png` - `ProgressRingHeightTest.png-dark` - `ProgressRingHeightTest.png` - `Using .3gp.png-dark` - `Using .3gp.png` - `Using .mp3 (Audio only).png-dark` - `Using .mp3 (Audio only).png` - `PasswordBox_AutoFill.png-dark` - `PasswordBox_AutoFill.png` - `SvgImageSource_Icons.png-dark`
* `skia-linux-screenshots`: **36** changed over 2178
🚨🚨 Comparison Details (first 20) 🚨🚨 - `ImageBrush_StreamSource.png-dark` - `ImageBrush_StreamSource.png` - `Ellipse.png-dark` - `Ellipse.png` - `Image_Stretch_None_ScrollViewer.png-dark` - `Image_Stretch_None_ScrollViewer.png` - `BorderImageBrushRelativeTransform.png-dark` - `BorderImageBrushRelativeTransform.png` - `ImageBrushAlignmentXY.png-dark` - `ImageBrushAlignmentXY.png` - `MediaPlayer.png-dark` - `MediaPlayer.png` - `MediaPlayerElement_Stretch_Fill.png-dark` - `MediaPlayerElement_Stretch_Fill.png` - `ListView_IsSelected.png-dark` - `ListView_IsSelected.png` - `Mini player.png-dark` - `Mini player.png` - `Sources.png-dark` - `Sources.png`
* `skia-windows-screenshots`: **16** changed over 2178
🚨🚨 Comparison Details (first 20) 🚨🚨 - `Image_Stretch_None.png-dark` - `Image_Stretch_None.png` - `Image_Stretch_None_ScrollViewer.png-dark` - `Image_Stretch_None_ScrollViewer.png` - `Ellipse.png-dark` - `Ellipse.png` - `Image_UseTargetSize.png-dark` - `Image_UseTargetSize.png` - `Native.png-dark` - `Native.png` - `MediaPlayer.png-dark` - `MediaPlayer.png` - `TransformToVisual_Translate2d.png-dark` - `TransformToVisual_Translate2d.png` - `WinUIProgressRingPage.png-dark` - `WinUIProgressRingPage.png`
* `wasm`: **62** changed over 1046
🚨🚨 Comparison Details (first 20) 🚨🚨 - `MUXControlsTestApp.NavigationViewAnimationPage` - `MUXControlsTestApp.NavigationViewStretchPage` - `MUXControlsTestApp.PersonPicturePage` - `SamplesApp.Wasm.Windows_UI_Xaml_Controls.ListView.ListView_IsSelected` - `SamplesApp.Windows_UI_Xaml_Controls.ListView.ListView_TextBox` - `UITests.Shared.Windows_UI_Xaml_Controls.ComboBox.ComboBox_DropDownPlacement` - `UITests.Shared.Windows_UI_Xaml_Controls.MediaPlayerElement.MediaPlayerElement_Flv_Extension` - `UITests.Shared.Windows_UI_Xaml_Controls.MediaPlayerElement.MediaPlayerElement_Minimal` - `UITests.Shared.Windows_UI_Xaml_Controls.MediaPlayerElement.MediaPlayerElement_Mkv_Extension` - `UITests.Windows_ApplicationModel.DataTransfer.DataTransferManagerTests` - `GenericApp.Views.Samples.Shared.Content.UITests.GridViewMultipleSelectionMode` - `SamplesApp.Samples.RoutedEvents.RoutedEventsPage` - `SamplesApp.Windows_UI_Xaml_Controls.ListView.ListViewSelectedItems` - `SamplesApp.Windows_UI_Xaml_Shapes.StretchPage` - `UITests.Microsoft_UI_Xaml_Controls.RatingControlTests.RatingControlPage` - `UITests.Microsoft_UI_Xaml_Controls.RefreshContainerTests.RefreshContainerHorizontalScroll` - `UITests.Shared.Windows_UI_Xaml_Controls.Button.Button_Events` - `UITests.Windows_UI_Xaml_Controls.ImageTests.SvgImageSource_FromMsAppData` - `UITests.Windows_UI_Xaml_Controls.ImageTests.SvgImageSource_FromStream` - `UITests.Windows_UI_Xaml_Controls.TextBox.TextBox_IsTabStop`
* `wasm-automated-net7.0-UWP-Default-automated`: **27** changed over 1954
🚨🚨 Comparison Details (first 20) 🚨🚨 - `Brushes_Uno_UI_Samples_UITests_ImageBrushTestControl_Ellipse_Uno_UI_Samples_UITests_ImageBrushTestControl_Ellipse` - `Default_SamplesApp_Wasm_Windows_UI_Xaml_Controls_ListView_ListView_IsSelected_SamplesApp_Wasm_Windows_UI_Xaml_Controls_ListView_ListView_IsSelected` - `MediaPlayerElement_MediaPlayerElement_Stretch_Fill_UITests_Shared_Windows_UI_Xaml_Controls_MediaPlayerElement_MediaPlayerElement_Stretch_Fill` - `MediaPlayerElement_Mini_player_UITests_Shared_Windows_UI_Xaml_Controls_MediaPlayerElement_MediaPlayerElement_Minimal` - `ListView_SelectedItems_SamplesApp_Windows_UI_Xaml_Controls_ListView_ListViewSelectedItems` - `Check_CornerRadius_Border_CornerRadius=5` - `MinMaxTest_UITests_Shared_Microsoft_UI_Xaml_Controls_NumberBoxTests_NumberBoxPage` - `Brushes_BorderImageBrush_Uno_UI_Samples_UITests_ImageBrushTestControl_BorderImageBrush` - `SequentialAnimations_SamplesApp_Windows_UI_Xaml_Media_Animation_SequentialAnimationsPage` - `When_ExtendedSelectionWithoutItemClick_Then_PointersEvents_UITests_Windows_UI_Xaml_Controls_ListView_ListView_Selection_Pointers` - `Progress_UITests_Microsoft_UI_Xaml_Controls_ProgressRing_WinUIProgressRingPage_UITests_Microsoft_UI_Xaml_Controls_ProgressRing_WinUIProgressRingPage` - `When_SingleSelectionWithItemClick_Then_PointersEvents_UITests_Windows_UI_Xaml_Controls_ListView_ListView_Selection_Pointers` - `When_SingleSelectionWithoutItemClick_Then_PointersEvents_UITests_Windows_UI_Xaml_Controls_ListView_ListView_Selection_Pointers` - `ListView_ListViewSelectedItems_SamplesApp_Windows_UI_Xaml_Controls_ListView_ListViewSelectedItems` - `MediaPlayerElement_Sources_UITests_Shared_Windows_UI_Xaml_Controls_MediaPlayerElement_MediaPlayerElement_Sources` - `MediaPlayerElement_Using_3gp_UITests_Shared_Windows_UI_Xaml_Controls_MediaPlayerElement_MediaPlayerElement_3gp_Extension` - `MediaPlayerElement_Using_avi_UITests_Shared_Windows_UI_Xaml_Controls_MediaPlayerElement_MediaPlayerElement_Avi_Extension` - `MediaPlayerElement_Using_mp3_Audio_only_UITests_Shared_Windows_UI_Xaml_Controls_MediaPlayerElement_MediaPlayerElement_Mp3_Extension` - `TestProgressRing_InitialState_UITests_Microsoft_UI_Xaml_Controls_ProgressRing_WinUIProgressRing_Features` - `When_MultipleSelectionWithoutItemClick_Then_PointersEvents_UITests_Windows_UI_Xaml_Controls_ListView_ListView_Selection_Pointers`
* `wasm-automated-net7.0-UWP-RuntimeTests-0`: **0** changed over 1 * `wasm-automated-net7.0-UWP-RuntimeTests-1`: **0** changed over 1 * `wasm-automated-net7.0-UWP-RuntimeTests-2`: **0** changed over 1 * `wasm-automated-net7.0-WinUI-Benchmarks-automated`: **0** changed over 1 * `wasm-automated-net7.0-WinUI-RuntimeTests-0`: **0** changed over 1 * `wasm-automated-net7.0-WinUI-RuntimeTests-1`: **0** changed over 1 * `wasm-automated-net7.0-WinUI-RuntimeTests-2`: **0** changed over 1