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

[net9.0] Merge main to net9.0 #20935

Merged
merged 24 commits into from
Mar 1, 2024
Merged

[net9.0] Merge main to net9.0 #20935

merged 24 commits into from
Mar 1, 2024

Conversation

rmarinho
Copy link
Member

@rmarinho rmarinho commented Mar 1, 2024

Description of Change

Bring latest changes from main to net9.0 and enable 1ESPT

jonathanpeppers and others added 24 commits February 27, 2024 15:10
* [ios] fix memory leak in SearchBar

Context: #16346

This addresses the memory leak discovered by:

    src/Core/src/Platform/iOS/MauiSearchBar.cs(36,63): error MA0001: Event 'TextSetOrChanged' could cause memory leaks in an NSObject subclass. Remove the event or add the [UnconditionalSuppressMessage("Memory", "MA0001")] attribute with a justification as to why the event will not leak.
    src/Core/src/Platform/iOS/MauiSearchBar.cs(54,32): error MA0001: Event 'OnMovedToWindow' could cause memory leaks in an NSObject subclass. Remove the event or add the [UnconditionalSuppressMessage("Memory", "MA0001")] attribute with a justification as to why the event will not leak.
    src/Core/src/Platform/iOS/MauiSearchBar.cs(55,32): error MA0001: Event 'EditingChanged' could cause memory leaks in an NSObject subclass. Remove the event or add the [UnconditionalSuppressMessage("Memory", "MA0001")] attribute with a justification as to why the event will not leak.
    src/Core/src/Platform/iOS/MauiSearchBar.cs(70,31): error MA0003: Subscribing to events with instance method 'OnEditingChanged' could cause memory leaks in an NSObject subclass. Remove the subscription or convert the method to a static method.

I could reproduce a leak in a test such as:

    await InvokeOnMainThreadAsync(() =>
    {
        var layout = new Grid();
        var searchBar = new SearchBar();
        layout.Add(searchBar);
        var handler = CreateHandler<LayoutHandler>(layout);
        viewReference = new WeakReference(searchBar);
        handlerReference = new WeakReference(searchBar.Handler);
        platformViewReference = new WeakReference(searchBar.Handler.PlatformView);
    });

    await AssertionExtensions.WaitForGC(viewReference, handlerReference, platformViewReference);
    Assert.False(viewReference.IsAlive, "SearchBar should not be alive!");
    Assert.False(handlerReference.IsAlive, "Handler should not be alive!");
    Assert.False(platformViewReference.IsAlive, "PlatformView should not be alive!");

Solved the issues by making a non-NSObject `MauiSearchBarProxy` class.

I found & fixed a couple related issues:

* `SearchBarExtensions.GetSearchTextField()` would have always thrown
  `StackOverlowException` if iOS was less than 13? It just called itself?!?

* Removed `MauiSearchBar.EditingChanged`, as we could subscribe to the
  event from the `UITextField` directly instead.

* Restore some changes, `_editor` field

* Code cleanup

* Call updateText in OnEditingChanged

---------

Co-authored-by: tj-devel709 <tj.devel709@gmail.com>
* apply the UINavigationController changes

* increase delay for moving to editor with keyboard open
* Allow updateFrames more than once

* Add device test
… ItemsViewController (#19875)

* Add MauiCollectionView and ignore ScrollRectToVisible if KeyboardAutoManagerScroll is enabled

* Add UITest and use the current NavigationController in the scrolling logic

* Move MauiCollectionView type into Microsoft.Maui.Controls.Handlers.Items from Controls.Core.Handlers.Items

* Remove added PublicAPI changes for MauiCollectionView

---------

Co-authored-by: tj-devel709 <tj.devel709@gmail.com>
* Log UI data for failure

* - add sleep

* - change appium tests to be single task
* Handle possible exception accessing ConnectionProfiles in Windows

* Add debug msg

---------

Co-authored-by: Mike Corsaro <mikecorsaro@microsoft.com>
…20793)

* Pull default colors from styles

* - add tests

* Update TabbedPageManager.cs
* Fixed Shell.NavBarHasShadow on Android

* Updated sample

* Added device test

* Update ShellToolbarTracker.cs

---------

Co-authored-by: javiersuarezruiz@hotmail.com <javiersuarezruiz@hotmail.com>
…ing firing more times than expected (#20905)

* Tests

* Fix

* Just .NET 8

* Revert "Just .NET 8"

This reverts commit cc6fc71.
* Added categories to appium tests

* Fix build error
* Updated branch to use info

* More changes

* Update .github/DEVELOPMENT.md

Co-authored-by: Pedro Jesus <pedrojesus.cefet@gmail.com>

* Changes from PR feedback

---------

Co-authored-by: Pedro Jesus <pedrojesus.cefet@gmail.com>
* * Fix template check for item recycle
* Ifdef `UseMauiMaps` for Windows in sandbox app

* Switch to use extension method

* Revert changes to MainPage

* Last file :)

---------

Co-authored-by: Mike Corsaro <mikecorsaro@microsoft.com>
* [C] Propagate resource changes to Background

- fixes #18545

* apply same fix elsewhere
* [ci] Enable 1ES

Try no pool

Extend

Add pool

try again

Use additional artifacts

try again

additionartifacts parameters

again

again

Publish artifact

Update

other target path

Try new image

Use image prop

try again

update path

try artifactsPath

missing s

Update internal

Spot bugs

Fix place

enable sign

Fix identation

Fix sign

again

Try do insertion

try again

again

use parameters

again

does this one works

Clean

ufff

Try fix sdk insertion

try insertion

Fix variables

try again

remove copy paste

fix supress

sourceRepositoriesToScan

nuget-signed

add insertion

Fix msi

fix sourceanalyst

fix pool

Add suppressionsFile for credScan

Fix variable name

Add SetupNugetSources.ps1 to CredScan supression

Cleanup

Add parameters.

Fix setup

if we fix it don't ignore it

Fix internal

try move binaries outside nuget

Push artifacs on i1esp

Disable loc

try other pool

Fix reference

try add apiscan and compliance

Try again

Only binaries for scan on windows

fix path

use @self

cleanup

fix

use old way on handlers

Fix pack

[ci] On Maui we can run less

try gndusupress

Don't use crescan suppressionsFile

* More updates

* [ci] Policheck by default with 1ES

* Update sdk-insertion.yml
# Conflicts:
#	eng/pipelines/common/variables.yml
@rmarinho rmarinho added the area-infrastructure CI, Maestro / Coherency, upstream dependencies/versions label Mar 1, 2024
@rmarinho rmarinho requested a review from a team as a code owner March 1, 2024 09:37
@rmarinho rmarinho merged commit e9210a7 into net9.0 Mar 1, 2024
44 of 48 checks passed
@rmarinho rmarinho deleted the merge-main-net9 branch March 1, 2024 13:59
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.