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

updateOne/updateMany should not change ids state on existing entity #571

Closed
bbaia opened this issue Nov 16, 2017 · 2 comments · Fixed by #581
Closed

updateOne/updateMany should not change ids state on existing entity #571

bbaia opened this issue Nov 16, 2017 · 2 comments · Fixed by #581

Comments

@bbaia
Copy link
Contributor

bbaia commented Nov 16, 2017

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?

updateOne/updateMany updates ids state when updating existing entity.

Expected behavior:

updateOne/updateMany should not change ids state if you attempt to update an entity that has already been added.

Minimal reproduction of the problem with instructions:

Did not run it, but try something like that

  it('should not change ids state if you attempt to update an entity that has already been added', () => {
    const withOne = adapter.addOne(TheGreatGatsby, state);
    const changes = { title: 'A New Hope' };

    const withUpdates = adapter.updateOne(
      {
        id: TheGreatGatsby.id,
        changes,
      },
      withOne
    );

    expect(withOne.ids).toBe(withUpdates.ids);
  });

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

Other information:

@bbaia
Copy link
Contributor Author

bbaia commented Nov 18, 2017

I will work on a PR this week.

@mansourcodes
Copy link

Does this bug solved ?
because updateOne still change the ids state

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

Successfully merging a pull request may close this issue.

3 participants