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

Duplicate entities returned by EntityQuery #1073

Open
jvdberg08 opened this issue Oct 10, 2023 · 0 comments
Open

Duplicate entities returned by EntityQuery #1073

jvdberg08 opened this issue Oct 10, 2023 · 0 comments

Comments

@jvdberg08
Copy link

Is this a regression?

No

Description

When using the entityStore.set([x, y]) method, where x and y are duplicates, the store's ids array will contain this id 2 times (ids.push(x[idKey]); ids.push(y[idKey])), while the entities map will only contain the entity once (entities[x[idKey]] = x; entities[y[idKey]] = y).

The entity query's select methods seem to map the ids array to an array of entities by performing a lookup in this map, which causes the entity to be included 2 times, even though it is only present once in the store.

Please provide a link to a minimal reproduction of the bug

https://akita-todos-app-ahgmj4.stackblitz.io

Please provide the exception or error you saw

No response

Please provide the environment you discovered this bug in

No response

Anything else?

No response

Do you want to create a pull request?

No

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

1 participant