-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Setting async belongsTo not working after previous fetch rejected #6867
Comments
Thanks! If you have time to turn your reproduction into a test scenario that would be awesome, but regardless thanks for the report. cc @code0100fun let's roll this into the unload work since it's a similar issue to what you started out working on. |
Hi, @runspired, thanks for your response! Yeah, I'll try to get a test scenario written early this week |
@runspired - Here you go: #6874 |
Also faced with this issue during the upgrade to 3.12. I assume this behaviour is related: > record.set('myRelation', null)
null
> record.myRelation
Proxy {isFulfilled: false, isRejected: false, content: null, _belongsToState: {…}, _super: ƒ} |
@veelenga your example above seems like correct behavior, content is null |
Hey there @runspired and @code0100fun . Just checking to see if there is an ETA on this one yet |
@runspired G'day mate is there any movement here. Or is there a better way for us to move forward? I loved the sit ups and your dog video. |
Description
Starting with ember-data version 3.12.0, setting a
belongsTo
relationship property on a model is not working after that relationship previously rejected. As an example, if an async fetch of a post'suser
returns a 404, I'm then catching the error, creating a new user, and setting it to the post:Expected
this.post.user
is now the new userActual
this.post.user
continues to be the rejected promise from the firstget
I'm pretty sure this has to do with this change: #6112
This issue does not occur in version 3.11.5 and below.
Reproduction - Failing Case (v3.12.0)
yarn && yarn start
Notice that the user name never populates, and
isRejected
is always trueReproduction - Non-failing Case (v3.11.5)
yarn && yarn start
Notice that the user name does populate successfully
Versions - Failing Case
Versions - Non-failing Case
The text was updated successfully, but these errors were encountered: