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

AdvancedCollectionView crashes with ArgumentOutOfRangeException with live shaping (filtering) #4813

Open
2 of 14 tasks
myblindy opened this issue Dec 7, 2022 · 2 comments
Open
2 of 14 tasks
Labels
bug 🐛 An unexpected issue that highlights incorrect behavior In-PR 🚀

Comments

@myblindy
Copy link

myblindy commented Dec 7, 2022

Describe the bug

As the title says, binding the collection to an ItemsRepeater and changing properties it's being filtered by (specifically, showing items) makes it crash with the aforementioned exception.

Regression

none

Reproducible in sample app?

  • This bug can be reproduced in the sample app.

Steps to reproduce

The WinUI stuff is incredibly difficult to debug due to no working source link and a very, very, VERY buggy WrapLayout implementation, but once I narrowed it down to the collection and cloned this project, the steps to reproduce this seems to be as so:

  1. The source collection is in a state like [PASS, PASS, FAIL, FAIL, FAIL], where PASS means it passes the live shaping filter and FAIL the opposite.
  2. Update it to [PASS, PASS, FAIL, PASS, FAIL], where the new item to show isn't in the first contiguous part, nor at the very end. This is important because of the case it falls into the large chain of conditions in HandleItemAdded.

Expected behavior

I would simply expect the advanced view collection to work.

Screenshots

No response

Windows Build Number

  • Windows 10 1809 (Build 17763)
  • Windows 10 1903 (Build 18362)
  • Windows 10 1909 (Build 18363)
  • Windows 10 2004 (Build 19041)
  • Windows 10 20H2 (Build 19042)
  • Windows 10 21H1 (Build 19043)
  • Windows 11 21H2 (Build 22000)
  • Other (specify)

Other Windows Build number

No response

App minimum and target SDK version

  • Windows 10, version 1809 (Build 17763)
  • Windows 10, version 1903 (Build 18362)
  • Windows 10, version 1909 (Build 18363)
  • Windows 10, version 2004 (Build 19041)
  • Other (specify)

Other SDK version

No response

Visual Studio Version

2022

Visual Studio Build Number

Version 17.5.0 Preview 1.0

Device form factor

Desktop

Nuget packages

    <PackageReference Include="CommunityToolkit.WinUI.UI" Version="7.1.2" />
    <PackageReference Include="CommunityToolkit.WinUI.UI.Controls" Version="7.1.2" />

Additional context

No response

Help us help you

Yes, I'd like to be assigned to work on this item.

@myblindy myblindy added the bug 🐛 An unexpected issue that highlights incorrect behavior label Dec 7, 2022
@ghost ghost added the needs triage 🔍 label Dec 7, 2022
@ghost
Copy link

ghost commented Dec 7, 2022

Hello myblindy, thank you for opening an issue with us!

I have automatically added a "needs triage" label to help get things started. Our team will analyze and investigate the issue, and escalate it to the relevant team if possible. Other community members may also look into the issue and provide feedback 🙌

@myblindy
Copy link
Author

myblindy commented Dec 7, 2022

I am aware of #4349, but that's been around and open for years. I ran into this problem this week so it was never fixed.

Also my fix is more localized and it strictly improves my specific problem. I can't say it fixes every problem with this function, but at least it doesn't make it worse. Given the propensity of WinUI to just crash out of the blue, one fix today is much more important than more fixes 2 years later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 An unexpected issue that highlights incorrect behavior In-PR 🚀
Projects
None yet
Development

No branches or pull requests

1 participant