Unchanged hasMany causing isDirty
See original GitHub issueI’m working on some code to autosave my model. It looks like:
export default Route.extend({
autosave: task(function * () {
yield timeout(3000);
this.get('model').save();
}).restartable(),
model(params) {
return this.store.findRecord('task', params.taskId);
},
afterModel(model) {
this.set('model', model);
},
modelChanged: observer('model.isDirty', function() {
if(this.get('model.isDirty')) {
window.console.log(this.get('model').changed());
this.get('autosave').perform();
}
})
});
I have the model configured with: changeTracker: { trackHasMany: true, auto: true, enableIsDirty: true }
When I change a string “deliverables” attribute in the model, I get on the console:
{deliverables: Array(2), subscribers: true}
{subscribers: true}
{}
Why does it think subscribers changed? subscribers is modeled as: subscribers: hasMany('user', {inverse: null})
Issue Analytics
- State:
- Created 6 years ago
- Comments:12 (8 by maintainers)
Top Results From Across the Web
Here's what may happen if you do not change your underwear ...
Unclean panties cause irritation to the skin because of bacterial buildup down there. Sweating, dead skin or microbe infestations are common ...
Read more >6 Signs of Low Transmission Fluid
Dark, dirty or burnt-smelling fluid are signs that the fluid is old and no longer effective. Your transmission filter likely needs to be...
Read more >Why does the loss/accuracy fluctuate during the training ...
There are several reasons that can cause fluctuations in training loss over epochs. The main one though is the fact that almost all...
Read more >Recordkeeping - Detailed Guidance for OSHA's Injury and ...
... factors have played a tangible role in causing the injury or illness, ... STS concept in the context of a hearing conservation...
Read more >JPA EntityManager: Why use persist() over merge()?
This new book has many new information then former one. ... merge and persist methods whose overlapping behavior may cause confusion not only...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
wow … this is blast from the past. but i would suggest you make a PR and write a test or make the fix in the change tracker repo, that way I can check it out and see if it makes sense. I still don’t follow the test and for sure you can’t do a fix where you open the ember-data store. that not going to make anyone happy. but if you can do a better fix or explain the issue in a test ( in change tracker ) then I happy to check it out
oooo … this sounds like a bug.
can you do me a huge favour and make a test to show this ( broken behaviour ) and slap it in a PR so I can fix it / see the breaking thing / check it out that way?