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

App crashes when you clear a group's record in CollectionView #20819

Closed
simon10says opened this issue Feb 23, 2024 · 5 comments
Closed

App crashes when you clear a group's record in CollectionView #20819

simon10says opened this issue Feb 23, 2024 · 5 comments
Labels
area-controls-collectionview CollectionView, CarouselView, IndicatorView p/2 Work that is important, but is currently not scheduled for release platform/android 🤖 potential-regression This issue described a possible regression on a currently supported version., verification pending s/triaged Issue has been reviewed s/try-latest-version Please try to reproduce the potential issue on the latest public version s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working

Comments

@simon10says
Copy link

Description

I've a grouped collectionview that is binded to ObservableCollection. When I Clear() a group of its records and re- Add(), I get IndexOutOfBoundsException as shown below:

image

Steps to Reproduce

  1. Run my repo and you will see the collectionview with 2 groups (Bears and Monkeys)
    1708706991796(1)

  2. Click on the Remove Record toolbar item and the Asian Black Bear record will be removed

  3. Click on the Add Record and you will get the IndexOutOfBoundsException

Link to public reproduction project repository

https://github.com/simon10says/maui-CollectionViewGroupBug

Version with bug

8.0.7 SR2

Is this a regression from previous behavior?

Yes, this used to work in .NET MAUI

Last version that worked well

8.0.3 GA

Affected platforms

Android, I was not able test on other platforms

Affected platform versions

No response

Did you find any workaround?

This issue seems to be due to ObservableCollection.Clear(). In my code I Remove Record via:

Animals[0].Clear(); //Animals[0] is the Bears group and this caused the exception when re-add

If I use RemoveAt() instead, I will not get the exception when I re-add the record

while (Animals[0].Count > 0)
{
    Animals[0].RemoveAt(0);
}

Relevant log output

No response

@simon10says simon10says added the t/bug Something isn't working label Feb 23, 2024
@jfversluis jfversluis added platform/android 🤖 area-controls-collectionview CollectionView, CarouselView, IndicatorView potential-regression This issue described a possible regression on a currently supported version., verification pending labels Feb 26, 2024
@ninachen03
Copy link

I can repro it with 17.10.0 Preview 1.0 on android platform
image

@ninachen03 ninachen03 added s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage labels Mar 6, 2024
@jsuarezruiz jsuarezruiz added this to the Backlog milestone Mar 11, 2024
@r-work
Copy link

r-work commented Apr 9, 2024

Can repro with maui 8.0.14

@malsabi
Copy link

malsabi commented Jul 10, 2024

Is there a clear workaround for this and supports animation when collapsing / expanding ?

@samhouts samhouts added s/verified Verified / Reproducible Issue ready for Engineering Triage s/triaged Issue has been reviewed labels Jul 10, 2024
@PureWeen PureWeen modified the milestones: Backlog, .NET 9 Servicing Dec 12, 2024
@PureWeen PureWeen removed their assignment Dec 12, 2024
@vishnumenon2684 vishnumenon2684 added partner/syncfusion Issues / PR's with Syncfusion collaboration and removed partner/syncfusion Issues / PR's with Syncfusion collaboration labels Dec 12, 2024
@devanathan-vaithiyanathan
Copy link
Contributor

This issue does not reproduce in the maui version (9.0.12) with VSCode 1.94.2 and Android Pixel 8 API 35 (Android 15).

Demo.mov

@vishnumenon2684 vishnumenon2684 added the s/try-latest-version Please try to reproduce the potential issue on the latest public version label Dec 12, 2024
Copy link
Contributor

Hi @simon10says. We have added the "s/try-latest-version" label to this issue, which indicates that we'd like you to try and reproduce this issue on the latest available public version. This can happen because we think that this issue was fixed in a version that has just been released, or the information provided by you indicates that you might be working with an older version.

You can install the latest version by installing the latest Visual Studio (Preview) with the .NET MAUI workload installed. If the issue still persists, please let us know with any additional details and ideally a reproduction project provided through a GitHub repository.

This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

@dotnet-policy-service dotnet-policy-service bot removed this from the .NET 9 Servicing milestone Dec 19, 2024
@github-project-automation github-project-automation bot moved this from Todo to Done in MAUI SDK Ongoing Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-controls-collectionview CollectionView, CarouselView, IndicatorView p/2 Work that is important, but is currently not scheduled for release platform/android 🤖 potential-regression This issue described a possible regression on a currently supported version., verification pending s/triaged Issue has been reviewed s/try-latest-version Please try to reproduce the potential issue on the latest public version s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Projects
Status: Done
Development

No branches or pull requests

10 participants