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

Attempts to set property after model is deleted/rolled back #94

Closed
kmiyashiro opened this issue Feb 11, 2016 · 12 comments
Closed

Attempts to set property after model is deleted/rolled back #94

kmiyashiro opened this issue Feb 11, 2016 · 12 comments
Labels
Milestone

Comments

@kmiyashiro
Copy link

On master, if a model's attribute is bound to the value of the select, you set a default value with selected=true, and you destroy/rollback a new model, it will trigger a

Uncaught Error: Attempted to handle event didSetProperty` error. 
It's attempting to modify the attribute after the model is set to `deleted.saved`.

This does not occur in 2.0.2.

Test case project: https://github.com/kmiyashiro/xselect-example

  1. Go to /wombat route
  2. Click on "back" link
  3. Error in console
@Robdel12 Robdel12 added this to the v2.1.0 milestone Feb 11, 2016
@lydiaguarino lydiaguarino self-assigned this Feb 11, 2016
@Robdel12
Copy link
Collaborator

Hi @kmiyashiro!

Could I get a stack trace / example code / steps to reproduce? I'm having trouble replicating this.

@kmiyashiro
Copy link
Author

I'll try reproducing in an isolated test case

@kmiyashiro
Copy link
Author

Sorry, I forgot to mention that I was using the default selection feature (selected=true) and that the list was bound to an array.

@kmiyashiro
Copy link
Author

Here's a project that shows the issue. https://github.com/kmiyashiro/xselect-example

  1. Go to /wombat route
  2. Click on "back" link
  3. Error in console

@Robdel12
Copy link
Collaborator

This error also pops its head up if you rollback the model and then make a new selection.

@Robdel12
Copy link
Collaborator

Robdel12 commented Mar 7, 2016

Hey @kmiyashiro! Sorry this has taken so long. I do have another question: are you only rolling back on newly created records and seeing this error? Or is this an issue when rolling back an existing model?

I also created an issue on Ember Data to get a little more help. If you'd like to follow along: emberjs/data#4209

@kmiyashiro
Copy link
Author

@Robdel12 That's the only time I saw it because I immediately rolled back x-select and used a different method to set the default value.

@Robdel12
Copy link
Collaborator

Robdel12 commented Mar 9, 2016

This should be fixed with the merge of #97. It does not fix rolling back a newly created model and trying to make a new selection since that's not the proper way to work with ember data.

But this does fix the issue of setting the value when the component is tearing down.

@Robdel12 Robdel12 closed this as completed Mar 9, 2016
@kmiyashiro
Copy link
Author

Thanks!

On Wed, Mar 9, 2016 at 11:18 AM, Robert DeLuca notifications@github.com
wrote:

Closed #94 #94.


Reply to this email directly or view it on GitHub
#94 (comment).

@Asherlc
Copy link

Asherlc commented Apr 25, 2016

I think this issue extends to another case -- a record that hasn't finished loading. In the case that you iterate over a hasMany relationship in the template, it'll start to render the template while the model is in root.loading, and the _setDefaultValues will raise a similar error.

@jrnk
Copy link

jrnk commented Aug 25, 2016

Experiencing the same as you ( @Asherlc ) on this, did you happen to solve it?

@Robdel12
Copy link
Collaborator

Interesting, can we open another issue to track this? And an ember-twiddle/repo project for these kinds of things are massively beneficial :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants