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] Ember 3.20.4 Does not Update When ED related records are removed #19105

Closed
jrjohnson opened this issue Aug 24, 2020 · 5 comments · Fixed by #19111
Closed

[Bug] Ember 3.20.4 Does not Update When ED related records are removed #19105

jrjohnson opened this issue Aug 24, 2020 · 5 comments · Fixed by #19111

Comments

@jrjohnson
Copy link
Sponsor

🐞 Describe the Bug

When records are removed from an ember data relationship the change is not being reflected in a template.

🔬 Minimal Reproduction

Reproduced in https://github.com/jrjohnson/reproduction-template-model-relationships
Steps:

  1. npm start
  2. Visit http://localhost:4200/tests?devmode
  3. Open Console
  4. Clicking Add POSTs a new record and re-computes the count and then {{log}} output.
  5. Clicking Clear PATCHs and removes the records, but does not update the count of the {{log}}.

😕 Actual Behavior

Removing all records from an Ember Data relationship array does not update the template.

🤔 Expected Behavior

Changing this array should always change the template.

🌍 Environment

  • Ember: 3.20.4
  • Node.js/npm: v12.18.2 / 6.14.6
  • OS: OSX
  • Browser: FF/Safari/Chrome
@jrjohnson
Copy link
Sponsor Author

May be related to or a duplicate of #19101, but I'm not sure so I created this new issue with the reproduction.

@rwjblue
Copy link
Member

rwjblue commented Aug 26, 2020

@pzuraq this seems like a similar issue to emberjs/data#7273, would you mind taking a look to see what is going on? This is broken between 3.20.3 and 3.20.4.

@pzuraq
Copy link
Contributor

pzuraq commented Aug 27, 2020

Dug into this, and figured out the issue. Have a fix ready, just need to write a test, will be doing that in the morning

@jrjohnson
Copy link
Sponsor Author

Confirmed. This is fixed in v3.20.5. Thanks!

@jrjohnson
Copy link
Sponsor Author

@pzuraq I'm seeing a related issue when not depending on .length, but just watching the array. Something like

{{did-update this.load @post.comments}}

Should I open a new issue and reproduction? Or should that have been covered in this fix?

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

Successfully merging a pull request may close this issue.

3 participants