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

Fixed ArgumentOutOfRangeException in AdvancedCollectionView #4349

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

w-ahmad
Copy link

@w-ahmad w-ahmad commented Oct 28, 2021

Fixes #4339

PR Type

What kind of change does this PR introduce?

Bugfix

What is the current behavior?

What is the new behavior?

PR Checklist

Please check if your PR fulfills the following requirements:

  • Tested code with current supported SDKs
  • New component
    • Pull Request has been submitted to the documentation repository instructions. Link:
    • Added description of major feature to project description for NuGet package (4000 total character limit, so don't push entire description over that)
    • If control, added to Visual Studio Design project
  • Sample in sample app has been added / updated (for bug fixes / features)
  • New major technical changes in the toolkit have or will be added to the Wiki e.g. build changes, source generators, testing infrastructure, sample creation changes, etc...
  • Tests for the changes have been added (for bug fixes / features) (if applicable)
  • Header has been added to all new source files (run build/UpdateHeaders.bat)
  • Contains NO breaking changes

Other information

@ghost
Copy link

ghost commented Oct 28, 2021

Thanks w-libs for opening a Pull Request! The reviewers will test the PR and highlight if there is any conflict or changes required. If the PR is approved we will proceed to merge the pull request 🙌

@ghost ghost requested review from michael-hawker and azchohfi October 28, 2021 21:00
@ghost ghost added the bug 🐛 An unexpected issue that highlights incorrect behavior label Oct 28, 2021
Copy link
Contributor

@XAML-Knight XAML-Knight left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR approved. Unfortunately, the issues in #4263 and #2913 still persist, even with this fix applied.

@w-ahmad
Copy link
Author

w-ahmad commented Oct 30, 2021

PR approved. Unfortunately, the issues in #4263 and #2913 still persist, even with this fix applied.

Thanks @XAML-Knight, These issues are not related to AdvancedCollectionView. If you try to use CollectionViewSource, same error will happen again. So the problem is within DataGrid at line 957, where we are trying to get removed item from collection but item is not exist.

image

@w-ahmad
Copy link
Author

w-ahmad commented Nov 2, 2021

I have opened a PR #4360 for these issues with a possible solution.

PR approved. Unfortunately, the issues in #4263 and #2913 still persist, even with this fix applied.

j++;
}
}
newViewIndex = _view.Select(x => _source.IndexOf(x)) // Get indexes of all items that are currently in view
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definitely worried about the performance impact here, this seems like a lot of extra work and memory to determine this calculation.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it could impact on performance, but not sure about any other possible solutions right now. Someone should have to run benchmark stuff on this method to get a better overview.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the unit test you added shows the failure case at least, then it'd be good if we can figure out how to fix the original algorithm here. We wouldn't want to add extra overhead to this helper.

This class is relatively isolated, so you may be able to pull it out to run benchmarking on it in isolation vs. trying to add benchmarking within the project. @Sergio0694 any tips/resources/articles to point @w-ahmad to for benchmarking code like this?

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AdvancedCollectionView throws ArgumentOutOfRangeException when live shaping set to true.
3 participants