ember.js: [3.13] Regression in computed property computation

Here is a reproduction repo

The last commit updates Ember to 3.13. When typing in the input, nothing happens.

The previous commit uses 3.12 and there, when typing in the checkbox, in the console a number of things happen - the computed property’s get is called and the value is also propagated to the “parent” component/controller.

This is a bug/regression.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 1
  • Comments: 17 (12 by maintainers)

Most upvoted comments

Yes, I believe @rwjblue and @pzuraq fixed it in #19028.

I’ve been talking with @rwjblue about this. Here’s a PR that adds a test to the Ember Codebase documenting the failure: https://github.com/emberjs/ember.js/pull/19028.

Per Robert, he’s located the cause, working on a solution.

in 3.12, this is what happens:

  1. Ember.set(child, 'a', 'foo')
  2. Calling Ember.set calls notifyPropertyChange(child, 'a')
  3. notifyPropertyChange calls dependentKeysDidChange
  4. dependentKeysDidChange ultimately causes notifyPropertyChange(child, 'value') to be called
  5. calling notifyPropertyChange for a value that was passed in to a component calls that components PROPERTY_DID_CHANGE method
  6. Ember.Component.prototype[PROPERTY_DID_CHANGE] implements the two way binding behaviors, and ultimately calls Ember.set(parent, 'string', 'foo') In 3.13+ there is no such thing as dependentKeysDidChange IF we had called notifyPropertyChange(child, 'value') the parent’s property would have been mutated properly, but we just don’t call it (since no code exists to do it)