Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Fix DataContext lost on second HR on Android #19524

Merged
merged 2 commits into from
Feb 14, 2025
Merged

Conversation

dr1rrb
Copy link
Member

@dr1rrb dr1rrb commented Feb 13, 2025

closes https://github.com/unoplatform/private/issues/611
closes https://github.com/unoplatform/private/issues/612
closes https://github.com/unoplatform/private/issues/617
closes https://github.com/unoplatform/private/issues/624
closes https://github.com/unoplatform/private/issues/645

Bugfix

Fix DataContext lost on second HR on Android

What is the current behavior?

As Frame does not allow easy update of Content, on HR we inject new instance (Page_v2) as Content of previous instance (Page_v1). We also flush DataContext of Page_v1 to make sure 2-way bindings are no longer triggered.

The issue is that on second HR (Page_v3) as the Page_v1 is still present in the tree, it matches (novelty of HR w/o cnomua) and is being used to clone properties to Page_v3, driving to clone an empty DataContext.

What is the new behavior?

We no longer clean the DataContext, so subsequent clones are still working. This should not have any impact for 2-way binding as anyway the Content of the original instance is being replaced by a new instance.

PR Checklist

@dr1rrb dr1rrb enabled auto-merge February 13, 2025 22:33
@github-actions github-actions bot added the platform/android 🤖 Categorizes an issue or PR as relevant to the Android platform label Feb 13, 2025
@unodevops
Copy link
Contributor

🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-19524/index.html

@unodevops
Copy link
Contributor

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

@jeromelaban
Copy link
Member

@Mergifyio backport release/stable/5.6

Copy link
Contributor

mergify bot commented Feb 14, 2025

backport release/stable/5.6

✅ Backports have been created

@unodevops
Copy link
Contributor

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

@unodevops
Copy link
Contributor

🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-19524/index.html

@unodevops
Copy link
Contributor

⚠️⚠️ The build 155100 has failed on Uno.UI - CI.

@nventive-devops
Copy link
Contributor

The build 155100 found UI Test snapshots differences: android-28-net8: 19, android-28-net8-Snap: 59, ios: 7, ios-Snap: 42, skia-gtk-screenshots: 64, skia-linux-screenshots: 69, skia-windows-screenshots: 64, wasm: 183, wasm-automated-net9.0-UWP-Default-automated: 1, wasm-automated-net9.0-UWP-RuntimeTests-0: 0, wasm-automated-net9.0-UWP-RuntimeTests-1: 0, wasm-automated-net9.0-UWP-RuntimeTests-2: 0, wasm-automated-net9.0-WinUI-Benchmarks-automated: 0, wasm-automated-net9.0-WinUI-RuntimeTests-0: 0, wasm-automated-net9.0-WinUI-RuntimeTests-1: 0, wasm-automated-net9.0-WinUI-RuntimeTests-2: 0

Details
  • android-28-net8: 19 changed over 829

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • DecimalFormatterTest_UITests_Shared_Microsoft_UI_Xaml_Controls_NumberBoxTests_NumberBoxPage
    • Detereminate_ProgressRing_Validation50_[#FF0000_#008000_#008000_#FF0000]_Progress-Ring-Value-50
    • Detereminate_ProgressRing_Validation25_[#FF0000_#008000_#FF0000_#FF0000]_Progress-Ring-Value-25
    • Detereminate_ProgressRing_Validation75_[#FF0000_#008000_#008000_#008000]_Progress-Ring-Value-75
    • Pivot_Non_PivotItemChange_Validation_UITests_Shared_Windows_UI_Xaml_Controls_Pivot_Pivot_CustomContent_Automated
    • ProgressRing_IsEnabled_Running_UITests_Windows_UI_Xaml_Controls_ProgressRing_WindowsProgressRing_GH1220
    • NativeCommandBar_Size_Uno_UI_Samples_Content_UITests_CommandBar_CommandBar_Dynamic
    • ProgressRing_Visibility_Collapsed_UITests_Windows_UI_Xaml_Controls_ProgressRing_WindowsProgressRing_GH1220
    • SequentialAnimations_SamplesApp_Windows_UI_Xaml_Media_Animation_SequentialAnimationsPage
    • Popup_PlacementTest_1Default_HSVS_Uno_UI_Samples_Content_UITests_Popup_Popup_HVAlignments
    • UpDownEnabledTest_UITests_Shared_Microsoft_UI_Xaml_Controls_NumberBoxTests_NumberBoxPage
    • When_Click_Outside_Dialog_Expect_No_Dismiss_UITests_Shared_MessageDialogTests_MessageDialogTest
    • When_NoSelectionWithItemClick_Then_PointersEvents_UITests_Windows_UI_Xaml_Controls_ListView_ListView_Selection_Pointers
    • When_ExtendedSelectionWithoutItemClick_Then_PointersEvents_UITests_Windows_UI_Xaml_Controls_ListView_ListView_Selection_Pointers
    • When_NoSelection_Then_PointersEvents_UITests_Windows_UI_Xaml_Controls_ListView_ListView_Selection_Pointers
    • When_SingleSelectionWithoutItemClick_Then_PointersEvents_UITests_Windows_UI_Xaml_Controls_ListView_ListView_Selection_Pointers
    • UpDownTest_UITests_Shared_Microsoft_UI_Xaml_Controls_NumberBoxTests_NumberBoxPage
    • When_Parent_PointerMoved_After_drag_on_ScrollViewer_-_touch
    • ListView_SelectedItems_SamplesApp_Windows_UI_Xaml_Controls_ListView_ListViewSelectedItems
  • android-28-net8-Snap: 59 changed over 1067

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Border_AutoBorderStretchwithbottommargin_Uno_UI_Samples_UITests_BorderTestsControl_AutoBorderStretchwithbottommargin
    • Border_NonUniformThicknessandRadius_Uno_UI_Samples_UITests_BorderTestsControl_NonUniformThicknessandRadius
    • Border_OnepxThicknessandRadiusAndTextBlock_Uno_UI_Samples_UITests_BorderTestsControl_OnepxThicknessandRadiusAndTextBlock
    • MUX_UITests_Shared_Microsoft_UI_Xaml_Controls_TreeViewTests_TreeViewPage_UITests_Shared_Microsoft_UI_Xaml_Controls_TreeViewTests_TreeViewPage
    • Slider_Slider_Features_UITests_Shared_Windows_UI_Xaml_Controls_Slider_Slider_Features
    • Slider_Slider_Frequency_Uno_UI_Samples_Content_UITests_Slider_Slider_Frequency
    • Slider_Slider_Inside_ListViewHeader_Uno_UI_Samples_Content_UITests_Slider_Slider_Inside_ListViewHeader
    • Border_Circle_Uno_UI_Samples_UITests_BorderTestsControl_Circle
    • Brushes_ImageBrushChangingCornerRadius_Uno_UI_Samples_UITests_ImageBrushTestControl_ImageBrushChangingCornerRadius
    • MediaPlayerElement_Mini_player_UITests_Shared_Windows_UI_Xaml_Controls_MediaPlayerElement_MediaPlayerElement_Minimal
    • Icons_UITests_Windows_UI_Xaml_Controls_SymbolIconTests_SymbolIcon_Generic_UITests_Windows_UI_Xaml_Controls_SymbolIconTests_SymbolIcon_Generic
    • MUX_MUXControlsTestApp_RefreshContainerPage_MUXControlsTestApp_RefreshContainerPage
    • TextBox_Input_PasswordBox_Uno_UI_Samples_Content_UITests_TextBoxControl_Input_PasswordBox
    • Border_OnepxThicknessandRadius_Uno_UI_Samples_UITests_BorderTestsControl_OnepxThicknessandRadius
    • 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_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
    • Border_BorderTopwithmargins_Uno_UI_Samples_UITests_BorderTestsControl_BorderTopwithmargins
    • Border_Border_Simple_with_Opacity_Uno_UI_Samples_UITests_BorderTestsControl_Border_Simple_with_Opacity
  • ios: 7 changed over 267

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • ProgressRing_IsEnabled_Running_UITests_Windows_UI_Xaml_Controls_ProgressRing_WindowsProgressRing_GH1220
    • When_ExtendedSelectionWithoutItemClick_Then_PointersEvents_UITests_Windows_UI_Xaml_Controls_ListView_ListView_Selection_Pointers
    • When_SingleSelectionWithItemClick_Then_PointersEvents_UITests_Windows_UI_Xaml_Controls_ListView_ListView_Selection_Pointers
    • When_MultipleSelectionWithoutItemClick_Then_PointersEvents_UITests_Windows_UI_Xaml_Controls_ListView_ListView_Selection_Pointers
    • ProgressRing_Visibility_Collapsed_UITests_Windows_UI_Xaml_Controls_ProgressRing_WindowsProgressRing_GH1220
    • When_SingleSelectionWithoutItemClick_Then_PointersEvents_UITests_Windows_UI_Xaml_Controls_ListView_ListView_Selection_Pointers
    • When_NoSelection_Then_PointersEvents_UITests_Windows_UI_Xaml_Controls_ListView_ListView_Selection_Pointers
  • ios-Snap: 42 changed over 1058

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • ContentPresenter_ContentPresenter_Background_Uno_UI_Samples_Content_UITests_ContentPresenter_ContentPresenter_Background
    • Icons_UITests_Microsoft_UI_Xaml_Controls_ImageIconTests_ImageIconPage_UITests_Microsoft_UI_Xaml_Controls_ImageIconTests_ImageIconPage
    • ListView_ListViewHeaderFooterOnly_SamplesApp_Windows_UI_Xaml_Controls_ListView_ListViewHeaderFooterOnly
    • ListView_ListViewHeaderFooter_ImplicitlyBinded_SamplesApp_Windows_UI_Xaml_Controls_ListView_ListViewHeaderFooter_ImplicitlyBinded
    • NavigationView_MUXControlsTestApp_NavigationViewMinimalPage_MUXControlsTestApp_NavigationViewMinimalPage
    • TextBlock_TextBoxSizeChanging_Uno_UI_Samples_Content_UITests_TextBlockControl_TextBoxSizeChanging
    • NavigationView_FluentStyle_NavigationViewSample_SamplesApp_Samples_Microsoft_UI_Xaml_Controls_NavigationViewTests_FluentStyle_FluentStyle_NavigationViewSample
    • TextBlock_TextBlock_FixedWidth_With_DataBound_Run_Uno_UI_Samples_Content_UITests_TextBlockControl_TextBlock_FixedWidth_With_DataBound_Run
    • Icons_UITests_Shared_Windows_UI_Xaml_Controls_BitmapIconTests_BitmapIcon_Foreground_UITests_Shared_Windows_UI_Xaml_Controls_BitmapIconTests_BitmapIcon_Foreground
    • ListView_ListView_TextBox_SamplesApp_Windows_UI_Xaml_Controls_ListView_ListView_TextBox
    • Image_UITests_Shared_Windows_UI_Xaml_Controls_ImageTests_Image_Stretch_Algmnt_Inf_Horizontal_UITests_Shared_Windows_UI_Xaml_Controls_ImageTests_Image_Stretch_Algmnt_Inf_Horizontal
    • Default_Uno_UI_Samples_Content_UITests_WebView_WebView_AnchorNavigation_Uno_UI_Samples_Content_UITests_WebView_WebView_AnchorNavigation
    • Lottie_Lottie_Progress_UITests_Lottie_LottieProgressPage
    • MediaPlayerElement_Sources_UITests_Shared_Windows_UI_Xaml_Controls_MediaPlayerElement_MediaPlayerElement_Sources
    • TextBlock_TextBlockMultilineInStarStackPanel_Uno_UI_Samples_Content_UITests_TextBlockControl_TextBlockMultilineInStarStackPanel
    • 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
    • Brushes_ImageBrushStretch2_Uno_UI_Samples_UITests_ImageBrushTestControl_ImageBrushStretch2
    • Image_UITests_Shared_Windows_UI_Xaml_Controls_ImageTests_Image_Stretch_Algmnt_Inf_Vertical_UITests_Shared_Windows_UI_Xaml_Controls_ImageTests_Image_Stretch_Algmnt_Inf_Vertical
    • Image_UITests_Shared_Windows_UI_Xaml_Controls_ImageTests_Image_Stretch_Alignment_SizeOnControl_UITests_Shared_Windows_UI_Xaml_Controls_ImageTests_Image_Stretch_Alignment_SizeOnControl
  • skia-gtk-screenshots: 64 changed over 2238

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • UIElement_Layout_Bug2879.png-dark
    • UIElement_Layout_Bug2879.png
    • Ellipse.png
    • ClipboardTests.png-dark
    • ClipboardTests.png
    • ToggleButton_IsEnabled_Automated.png-dark
    • ToggleButton_IsEnabled_Automated.png
    • Gamepad_Enumeration.png-dark
    • ImageInStackPanel.png-dark
    • Popup_HVAlignments.png-dark
    • Popup_HVAlignments.png
    • ContentPresenter_NativeEmbedding.png
    • CompositionPath.png-dark
    • CompositionPath.png
    • Gamepad_Enumeration.png
    • PasswordBox_AutoFill.png-dark
    • PasswordBox_AutoFill.png
    • Ellipse.png-dark
    • ImageInStackPanel.png
    • WinUIExpanderPage.png-dark
  • skia-linux-screenshots: 69 changed over 2238

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Gamepad_CurrentReading.png-dark
    • Gamepad_CurrentReading.png
    • Gamepad_Enumeration.png-dark
    • Gamepad_Enumeration.png
    • ContentPresenter_NativeEmbedding.png-dark
    • ContentPresenter_NativeEmbedding.png
    • Buttons.png-dark
    • DragDrop_TestPage.png-dark
    • DragDrop_TestPage.png
    • ImageWithLateSourceUniformToFill.png-dark
    • ImageWithLateSourceUniformToFill.png
    • ButtonClippingTestsControl.png-dark
    • ClipboardTests.png-dark
    • ClipboardTests.png
    • Focus_FocusVisual_Properties.png-dark
    • Focus_FocusVisual_Properties.png
    • ImageBrush_StreamSource.png-dark
    • ImageBrush_StreamSource.png
    • CalendarView_Theming.png-dark
    • DisplayInformation.png-dark
  • skia-windows-screenshots: 64 changed over 2238

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • DisplayInformation.png-dark
    • Gamepad_CurrentReading.png-dark
    • Gamepad_Enumeration.png-dark
    • Gamepad_Enumeration.png
    • BorderImageBrushRelativeTransform.png
    • Examples.png
    • ExpanderColorValidationPage.png-dark
    • ExpanderColorValidationPage.png
    • BorderImageBrush.png
    • BorderImageBrushRelativeTransform.png-dark
    • ClipboardTests.png-dark
    • Image_UseTargetSize.png-dark
    • Image_UseTargetSize.png
    • BorderImageBrush.png-dark
    • Focus_FocusVisual_Properties.png-dark
    • ClipboardTests.png
    • CalendarView_Theming.png-dark
    • ColorPickerSample.png-dark
    • DropDownButtonPage.png-dark
    • ButtonClippingTestsControl.png-dark
  • wasm: 183 changed over 1043

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • MUXControlsTestApp.NavigationViewAnimationPage
    • MUXControlsTestApp.NavigationViewIsPaneOpenPage
    • MUXControlsTestApp.NavigationViewRS4Page
    • SamplesApp.Samples.NavigationViewSample.NavigationViewSample
    • SamplesApp.Wasm.Windows_UI_Xaml_Controls.ComboBox.ComboBox_ItemsSource
    • UITests.Shared.Windows_ApplicationModel.Email.EmailManagerTests
    • UITests.Shared.Windows_Devices.Midi.MidiDeviceEnumerationTests
    • UITests.Shared.Windows_UI_Xaml.xBindTests.xBind_Field
    • UITests.Shared.Windows_UI_Xaml.xBindTests.xBind_Functions
    • UITests.Shared.Windows_UI_Xaml_Controls.NavigationViewTests.NavigationView_TopNavigation
    • UITests.Shared.Windows_UI_Xaml_Controls.WebView.WebView_Animated_Opacity
    • UITests.Shared.Windows_UI_Xaml_Controls.WebView.WebView_NavigateToString2
    • UITests.Windows_UI_Xaml.DragAndDrop.DragDrop_TreeView
    • UITests.Windows_UI_Xaml_Controls.CheckBoxTests.CheckBox_States
    • UITests.Windows_UI_Xaml_Controls.ScrollViewerTests.ScrollViewer_Margin
    • UITests.Windows_UI_Xaml_Controls.ScrollViewerTests.ScrollViewer_Margin_Centered
    • MUXControlsTestApp.NavigationViewMenuItemStretchPage
    • MUXControlsTestApp.NavigationViewStretchPage
    • MUXControlsTestApp.SwipeControlPage
    • MUXControlsTestApp.SwipeControlPage2
  • wasm-automated-net9.0-UWP-Default-automated: 1 changed over 23

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • TestProgressRing_InitialState_UITests_Microsoft_UI_Xaml_Controls_ProgressRing_WinUIProgressRing_Features
  • wasm-automated-net9.0-UWP-RuntimeTests-0: 0 changed over 1

  • wasm-automated-net9.0-UWP-RuntimeTests-1: 0 changed over 1

  • wasm-automated-net9.0-UWP-RuntimeTests-2: 0 changed over 1

  • wasm-automated-net9.0-WinUI-Benchmarks-automated: 0 changed over 1

  • wasm-automated-net9.0-WinUI-RuntimeTests-0: 0 changed over 1

  • wasm-automated-net9.0-WinUI-RuntimeTests-1: 0 changed over 1

  • wasm-automated-net9.0-WinUI-RuntimeTests-2: 0 changed over 1

@dr1rrb dr1rrb merged commit 89718f9 into master Feb 14, 2025
115 checks passed
@dr1rrb dr1rrb deleted the dev/dr/hrUpdates branch February 14, 2025 20:35
jeromelaban added a commit that referenced this pull request Feb 17, 2025
…5.6/pr-19524

fix: Fix DataContext lost on second HR on Android (backport #19524)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform/android 🤖 Categorizes an issue or PR as relevant to the Android platform
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants