Skip to content

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

@myblindy

Description

@myblindy

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    In-PR 🚀bug 🐛An unexpected issue that highlights incorrect behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions