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

null value is sometimes added to entity ids by @ngrx/entity #781

Closed
livthomas opened this issue Feb 4, 2018 · 2 comments
Closed

null value is sometimes added to entity ids by @ngrx/entity #781

livthomas opened this issue Feb 4, 2018 · 2 comments

Comments

@livthomas
Copy link
Contributor

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report  
[ ] Feature request
[ ] Documentation issue or request

What is the current behavior?

When I add entities to the store using adapter.addAll() or adapter.addMany methods, null value is sometimes stored in ids array. If I then try to get entities using some selector, I get a function among those entities. This causes a lot of bugs in my application unless I always filter the returned entities.

Expected behavior:

There should not be any unwanted values inserted into the store.

Minimal reproduction of the problem with instructions:

I have not been able to reproduce this problem by unit tests in this project. However, I can always reproduce it in my application. I have debugged it for a while and discovered that this loop not only goes through entity keys but also iterates over Array prototype method names and as the result null key is pushed to ids array on this line.

Version of affected browser(s),operating system(s), npm, node and ngrx:

Chrome 64, Fedora 27, NPM 5.6.0, Node 8.9.4, NgRx 5.0.1

@DanielKucal
Copy link

Was it solved? Because I'm still experiencing the issue:
image

@timdeschryver
Copy link
Member

@DanielKucal feel free to open an issue with a reproduction if you're experiencing issues.
AFAIK, this is resolved.

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

3 participants