Skip to content

Comments

Merge main to net8#13430

Merged
PureWeen merged 25 commits intonet8.0from
merge-main-net8
Feb 17, 2023
Merged

Merge main to net8#13430
PureWeen merged 25 commits intonet8.0from
merge-main-net8

Conversation

@mandel-macaque
Copy link
Contributor

Description of Change

Merge main into net8 to bring a number of CI fixes to test the unified pipeline in net 8.

jsuarezruiz and others added 25 commits February 15, 2023 10:06
* Fix crash using Shell SearchHandler on Catalyst

* Updated changes

* Added device test

* Update src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/UIContainerCell.cs

Co-authored-by: Shane Neuville <shneuvil@microsoft.com>

* Fix merge issue

* Moved test

---------

Co-authored-by: Rui Marinho <me@ruimarinho.net>
Co-authored-by: Matthew Leibowitz <mattleibow@live.com>
Co-authored-by: Shane Neuville <shneuvil@microsoft.com>
* Final docs + WarningsAsErrors on Missing Docs

* Delete all unused XML files

* Update Permissions.tizen.cs
…10293

* [iOS] Set the attributed title on the button and not the inner label

* Just small cleanup on this file

* Reinstate test fix

---------

Co-authored-by: E.Z. Hart <hartez@gmail.com>
…ode would be duplicated (#13326)

Co-authored-by: Mike Corsaro <mikecorsaro@microsoft.com>
Bumps [coverlet.collector](https://github.com/coverlet-coverage/coverlet) from 3.1.2 to 3.2.0.
- [Release notes](https://github.com/coverlet-coverage/coverlet/releases)
- [Commits](https://github.com/coverlet-coverage/coverlet/commits/v3.2.0)

---
updated-dependencies:
- dependency-name: coverlet.collector
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Bump Microsoft.AspNetCore.Authorization from 7.0.2 to 7.0.3

Bumps [Microsoft.AspNetCore.Authorization](https://github.com/dotnet/aspnetcore) from 7.0.2 to 7.0.3.
- [Release notes](https://github.com/dotnet/aspnetcore/releases)
- [Changelog](https://github.com/dotnet/aspnetcore/blob/main/docs/ReleasePlanning.md)
- [Commits](dotnet/aspnetcore@v7.0.2...v7.0.3)

---
updated-dependencies:
- dependency-name: Microsoft.AspNetCore.Authorization
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Move other packages for 7.0.3

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Rui Marinho <me@ruimarinho.net>
* Fix crash using complex html content on Windows

* Use device test in all the platforms
Follow up of #13264

We need to be sure that the pwsh is executed from the right dir, the
simplest way is to set the working dir for the step.
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…ner (#13153) Fixes #13152

* At a minimum, call the base method

* Copy pattern from elsewhere in MAUI

* Implement requested changes
* Clarify test

* - fix spelling
Bumps Microsoft.Web.WebView2 from 1.0.1518.46 to 1.0.1587.40.

---
updated-dependencies:
- dependency-name: Microsoft.Web.WebView2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
) Fixes #12219

* Fix crash adding items to CollectionView on Android navigating

* Changes in test
* [iOS] Don't update the offset if there's no space available

* [iOS] Use the MauiLabel to set a label with insets

Using the constrains was keeping the UITextView from scrolling
* Fix issue using Shell FlyoutBackground on Windows

* Changes based on PR feedback

* Changes based on PR feedback

* Updated test

* Update src/Controls/tests/DeviceTests/Elements/Shell/ShellTests.Windows.cs

Co-authored-by: Manuel de la Pena <mandel@microsoft.com>

* Add missing ;

---------

Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
Fixes: #12039
Fixes: #10560
Context: https://github.com/Vroomer/MAUI-master-detail-memory-leak
Context: https://github.com/symbiogenesis/Maui.DataGrid/tree/memory-leak

In investigating various MAUI samples, I found the following object
leaking:

    WeakPropertyChangedProxy (referenced by ->)
        TypedBinding
        Binding

In ~2016, I contributed a fix to Xamarin.Forms:

xamarin/Xamarin.Forms@f6febd4

Back then, this solved the follow case:

1. You have a long-lived `ViewModel` class. Could be a singleton, etc.

2. Data-bind a `View` to this `ViewModel`.

3. The `ViewModel` indefinitely held on to any object that subscribed
   to `PropertyChanged`.

At the time, this solved a huge memory leak, because a data-bound
`View` would have a reference to its parent, then to its parent, etc.
Effectively this was leaking entire `Page`'s at the time.

Unfortunately, there was still a flaw in this change...
`WeakPropertyChangedProxy` hangs around forever instead! I could
reproduce this problem in unit tests, by accessing various internal
members through reflection -- asserting they were alive or not.

We do have another layer of indirection, where other objects are GC'd
that can free the `WeakPropertyChangedProxy`, such as:

    // Regular Binding
    ~BindingExpressionPart() => _listener?.Unsubscribe();
    // TypedBinding
    ~PropertyChangedProxy() => Listener?.Unsubscribe();

This means it would take two GC's for these objects to go away, but it
is better than the alternative -- they *can* actually go away now.

After testing apps with this change, sometimes I would get an
`InvalidOperationException` in `WeakReference<T>`:

https://source.dot.net/#System.Private.CoreLib/src/libraries/System.Private.CoreLib/src/System/WeakReference.T.cs,103

So I added a parameter to `Unsubscribe(finalizer: true)`, to skip
`WeakReference<T>.SetTarget()` from finalizers.

After this change, I still found an issue! In my new unit test, the
following would hold onto a `ViemModel` object forever:

    VisualElement.BackgroundProperty.DefaultValue

This held the value of `Brush.Default`, in which
`Brush.Default.BindingContext` was the `ViewModel`!

My first thought was for `Brush.Default` to return `ImmutableBrush`:

    public static Brush Default => defaultBrush ??= new ImmutableBrush(null);

Because anyone could do `Brush.Default.Color = Colors.Red` if they liked.

When this didn't fix it, I found the underlying `_inheritedContext` is
what held a reference to my `ViewModel` object. I changed this value
to a `WeakReference`.

The types of leaks this fixes:

* Bindings to application-lifetime, singleton `ViewModel`s

* Scrolling `CollectionView`, `ListView`, etc. with data-bindings.

* Styles that were used on a `View` or `Page` that is now removed from
  the screen via navigation, de-parenting, etc.

Ok, I really think the leaks are gone now. Maybe?
…e. (#13417)

Fix missing paths, this should be the last changes that are path related
🤞
Add path to missing missing ignored path and to the source folder.
@github-actions
Copy link
Contributor

Thank you for your pull request. We are auto-formating your source code to follow our code guidelines.

@Eilon Eilon added the area-infrastructure CI, Maestro / Coherency, upstream dependencies/versions label Feb 17, 2023
@PureWeen PureWeen merged commit 7ac56d3 into net8.0 Feb 17, 2023
@PureWeen PureWeen deleted the merge-main-net8 branch February 17, 2023 22:33
@github-actions github-actions bot locked and limited conversation to collaborators Dec 13, 2023
@samhouts samhouts added the fixed-in-8.0.0-preview.1.7762 Look for this fix in 8.0.0-preview.1.7762! label Aug 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-infrastructure CI, Maestro / Coherency, upstream dependencies/versions fixed-in-8.0.0-preview.1.7762 Look for this fix in 8.0.0-preview.1.7762! t/housekeeping ♻︎

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants