Skip to content

Fix CI failure for CollectionView and CarouselView tests in April 14th Candidate#35028

Merged
kubaflo merged 2 commits into
dotnet:inflight/candidatefrom
devanathan-vaithiyanathan:fix-candidate-failure-24610
Apr 18, 2026
Merged

Fix CI failure for CollectionView and CarouselView tests in April 14th Candidate#35028
kubaflo merged 2 commits into
dotnet:inflight/candidatefrom
devanathan-vaithiyanathan:fix-candidate-failure-24610

Conversation

@devanathan-vaithiyanathan

@devanathan-vaithiyanathan devanathan-vaithiyanathan commented Apr 18, 2026

Copy link
Copy Markdown
Contributor

Issue details:

PR #24610 switched collection change wiring to a weak event proxy to fix a memory leak, but the callback delegate was not strongly retained. As a result, GC could collect the delegate, so CollectionChanged notifications stopped reaching the Android items pipeline, which caused the CarouselView and CollectionView test failures.

Description of Change

In MarshalingObservableCollection.cs, added a strong field to hold the NotifyCollectionChangedEventHandler delegate.
In the constructor, assigned that field once and passed the stored delegate to WeakNotifyCollectionChangedProxy instead of passing a temporary method-group delegate.
Kept existing dispose/unsubscribe behavior so the leak fix remains intact while notifications continue to fire correctly.

Issue Fixed

Fixes #35104

Failure test cases

CarouselView tests fails

  • VerifyCarouselViewWithKeepItemInView
  • VerifyCarouselViewWithKeepItemInViewAndPreviousPosition
  • VerifyCarouselViewWithKeepItemInViewAndCurrentPosition
  • VerifyCarouselViewWithCurrentPosition
  • VerifyCarouselViewWithKeepLastItemInViewAndCurrentPosition
  • AddItemsToCarouselViewWorks

CollectionView test fails

  • VerifyModelItemsObservableCollectionWhenAddIndexAtItems
  • VerifyFlowDirectionRTLAndKeepLastItemInViewWithObservableListWhenVerticalGrid
  • VerifyFlowDirectionLTRAndKeepLastItemInViewWithObservableListWhenVerticalGrid
  • VerifyKeepLastItemInViewWithObservableListWhenVerticalGrid
  • VerifyKeepLastItemInViewWithObservableList
  • VerifyFlowDirectionLTRAndKeepLastItemInViewWithObservableListWhenHorizontalList
  • VerifyFlowDirectionRTLAndKeepLastItemInViewWithObservableListWhenHorizontalList
  • VerifyFlowDirectionRTLAndKee

Device Test fails

  • CollectionViewCanSizeToContent

@dotnet-policy-service dotnet-policy-service Bot added the partner/syncfusion Issues / PR's with Syncfusion collaboration label Apr 18, 2026
@sheiksyedm sheiksyedm marked this pull request as ready for review April 18, 2026 02:52
@sheiksyedm sheiksyedm added area-testing Unit tests, device tests community ✨ Community Contribution regressed-in-inflight/candidate labels Apr 18, 2026
@sheiksyedm

Copy link
Copy Markdown
Contributor

/azp run maui-pr-uitests

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@kubaflo kubaflo merged commit 01a94a2 into dotnet:inflight/candidate Apr 18, 2026
105 of 169 checks passed
@github-actions github-actions Bot modified the milestones: .NET 10 SR7, .NET 10 SR6 Apr 18, 2026
Ahamed-Ali pushed a commit that referenced this pull request Apr 22, 2026
…h Candidate (#35028)

<!--
!!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING
MAIN. !!!!!!!
-->

### Issue details:
PR #24610 switched collection change wiring to a weak event proxy to fix
a memory leak, but the callback delegate was not strongly retained. As a
result, GC could collect the delegate, so CollectionChanged
notifications stopped reaching the Android items pipeline, which caused
the CarouselView and CollectionView test failures.


### Description of Change

<!-- Enter description of the fix in this section -->
In MarshalingObservableCollection.cs, added a strong field to hold the
NotifyCollectionChangedEventHandler delegate.
In the constructor, assigned that field once and passed the stored
delegate to WeakNotifyCollectionChangedProxy instead of passing a
temporary method-group delegate.
Kept existing dispose/unsubscribe behavior so the leak fix remains
intact while notifications continue to fire correctly.

### Failure test cases
**CarouselView tests fails**
* VerifyCarouselViewWithKeepItemInView 
* VerifyCarouselViewWithKeepItemInViewAndPreviousPosition 
* VerifyCarouselViewWithKeepItemInViewAndCurrentPosition 
* VerifyCarouselViewWithCurrentPosition 
* VerifyCarouselViewWithKeepLastItemInViewAndCurrentPosition
* AddItemsToCarouselViewWorks
 
**CollectionView test fails**
* VerifyModelItemsObservableCollectionWhenAddIndexAtItems
*
VerifyFlowDirectionRTLAndKeepLastItemInViewWithObservableListWhenVerticalGrid
*
VerifyFlowDirectionLTRAndKeepLastItemInViewWithObservableListWhenVerticalGrid
* VerifyKeepLastItemInViewWithObservableListWhenVerticalGrid
* VerifyKeepLastItemInViewWithObservableList
*
VerifyFlowDirectionLTRAndKeepLastItemInViewWithObservableListWhenHorizontalList
*
VerifyFlowDirectionRTLAndKeepLastItemInViewWithObservableListWhenHorizontalList
* VerifyFlowDirectionRTLAndKee

**Device Test fails**
* CollectionViewCanSizeToContent
@PureWeen PureWeen modified the milestones: .NET 10 SR6, .NET 10 SR7 Apr 29, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-testing Unit tests, device tests community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration regressed-in-inflight/candidate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants