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

[BUG] Removing an item from an ObservableList with TrnasformMany and a projection #264

Closed
dchaib opened this issue Aug 7, 2019 · 5 comments

Comments

@dchaib
Copy link
Contributor

dchaib commented Aug 7, 2019

Describe the bug
As shown in RolandPheasant/DynamicData.Snippets#5, I have set up an ObservableList with TransFormMany and a projection inside. When I remove an item from the ObservableList, it is not removed from the output. It works with an ObservableCache.

As Roland guessed, the projected item is not removed from the list because it is not found. I believe the culprit is here: https://github.com/RolandPheasant/DynamicData/blob/67367d0068531a94c9ec8a3e197a0b0055f5eca4/DynamicData/List/ChangeAwareList.cs#L519. The call to IndexOf is not using the equalityComparer passed when using TransformMany. I haven't found a way to pass it properly (yet).

Steps To Reproduce
Run the unit tests in https://github.com/RolandPheasant/DynamicData.Snippets.

I'm also happy to send a PR with unit tests here.

Expected behavior
The items should be removed from the output.

Screenshots
n/a

Environment

  • OS: Windows
  • Version: tested in 6.8 (the issue is still present in the master branch today)
  • Device: n/a

Additional context

@dchaib dchaib added the bug label Aug 7, 2019
@dchaib
Copy link
Contributor Author

dchaib commented Aug 8, 2019

The issue is more how to pass the predicate to ChangeAwareList than using it ;-)

@dchaib
Copy link
Contributor Author

dchaib commented Aug 8, 2019

I may have found something. If that's OK, I'll submit a PR tomorrow and we can see if I'm headed in the right direction.

@RolandPheasant
Copy link
Collaborator

A PR is welcome. Thanks

@dchaib
Copy link
Contributor Author

dchaib commented Aug 13, 2019

I can confirm that this is fixed in 6.13.1 by #265.

@dchaib dchaib closed this as completed Aug 13, 2019
@lock lock bot added the outdated label Nov 11, 2019
@lock lock bot locked and limited conversation to collaborators Nov 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants