ember-sync icon indicating copy to clipboard operation
ember-sync copied to clipboard

Updating an exisitng model doesn't work

Open Globegitter opened this issue 9 years ago • 3 comments

I have the following code to create a new model:

testModel = this.emberSync.createRecord('test', {
  email: this.get('email'),
  name: this.get('name'),
});
testModel.emberSync.save();

This works fine and the model gets saved to the server.

At a later time (after the save has been successfully completed) the user enters something and the model gets updated as follows:

testModel.set('name', 'anothername');
testModel.set('otherAttribute', 'otherValue');
console.log(testModel.get('isDirty')) //true
testModel.emberSync.save();

Ember Inspector shows the new name, otherAttribute and isDirty is true. But no request gets sent to the server. Removing ember-sync and it works fine. Any idea what the issue could be?

Edit: Storing offline seems to work though.

Globegitter avatar Oct 14 '14 11:10 Globegitter

Not really. As far as I can remember, it's covered by tests and should work. Unfortunately I'm busy on a project that's not using Ember Sync, so I can't debug it myself. If you could do that, which wouldn't be that hard imo, I can help you out by pointing the ways.

kurko avatar Oct 14 '14 14:10 kurko

@Globegitter did you give up on this? I have some time and could take a look at it myself.

kurko avatar Feb 21 '15 16:02 kurko

@kurko Yes, we switched to a different solution for that app. I would still love to get this to work because we will most likely revisit ember-sync for a future project.

Globegitter avatar Feb 21 '15 17:02 Globegitter