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

Inner join, updates to left key #575

Open
andersstorhaug opened this issue Apr 6, 2022 · 5 comments
Open

Inner join, updates to left key #575

andersstorhaug opened this issue Apr 6, 2022 · 5 comments

Comments

@andersstorhaug
Copy link
Contributor

andersstorhaug commented Apr 6, 2022

From InnerJoin.cs, current head of main (follow link for more context):

joinedCache.Remove((leftKey, change.Key));

It appears that for an inner join, if a right value updates its left key, then InnerJoin will fail to remove it from the results if it no longer joins.

That's because on update of right values, results are removed only based on the current value of the left key, not the previous. To fix this, on update, It would seem that both current/previous left keys need to be taken into account.

I haven't had the time to look into this further / confirm, but I wanted to raise an issue here before I lose sight of it.

@RolandPheasant
Copy link
Collaborator

Thanks for pointing this out. I will take a look soon (on vacation right now).

@glennawatson
Copy link
Member

If you have time and want to help @RolandPheasant out, if you get time might be worth just providing a unit test to help out.

@andersstorhaug
Copy link
Contributor Author

Will do, I believe that both the reproduction and the fix are fairly simple, so I may be able to get a PR out here within a couple of days.

@RolandPheasant
Copy link
Collaborator

@andersstorhaug Is this still and issue?

@jbooth88
Copy link

I came here to add a feature request for this topic, and found this thread.

As of version 8.3.27 I think this is still happening. I encountered my own issue where an inner join had strange side effects when a key on the right side is modified at runtime.

https://github.com/jbooth88/DynamicData-Filtering-Join

Above is a link to a sample project I posted in Slack for review, it illustrates the issue. Unfortunately I am not comfortable in making unit tests, so I cannot help you there. :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants