Changeset changes array is not cleared when no changes exist
jeroen-hoekstra opened this issue · comments
Version
3.13.2
Test Case
https://github.com/jeroen-hoekstra/ember-changeset-issue
Steps to reproduce
After updating ember-changeset from 3.12.0 to 3.13.2 we noticed a difference in change tracking. Not sure if this is intended behaviour. You can run my test case with both versions and check the logs.
Open de console and notice that on page load the changeset changes array is empty. Initialy the hidden
property is false
. Toggle the first toggle so the hidden
property becomes true
. We see that the changeset changes array now contains the change object. When toggling it again the changeset changes array should become empty again, as the hidden
property becomes equal to it's initial value, which is false. This was the case with version 3.12.0 but with 3.13.2 the changeset changes array still contains the change object, but with it's value
set to false
.
Expected Behavior
Version 3.12
Actual Behavior
Version 3.13.2
Here's a fix using #586 spike. It has a few issues to be solved over there, but... it proves(?) it fix this.