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

Ember 2.10.2 + Ember Data 2.10.0 has bugs on relationships #5161

Closed
Leooo opened this issue Sep 1, 2017 · 3 comments
Closed

Ember 2.10.2 + Ember Data 2.10.0 has bugs on relationships #5161

Leooo opened this issue Sep 1, 2017 · 3 comments

Comments

@Leooo
Copy link

Leooo commented Sep 1, 2017

For example, a REST relationship failing because of an API error resolves the second time it is called (id(s) are set to null after first failure).

Updating Ember Data to 2.11.0 resolves the issue.

@Leooo
Copy link
Author

Leooo commented Sep 5, 2017

Please have a look at this twiddle to reproduce:

[https://ember-twiddle.com/305861d9a5e157117f350afa59215cb0?openFiles=routes.application.js%2C]
EDIT: MY TWIDDLE HAS BEEN OVERRIDEN WITH OLDER VERSION :(

//models/parent.js
export default Model.extend({
  child: belongsTo('child'),
  children: hasMany('child', {inverse: 'parentHasMany'})
});

all children API calls fail normally from Mirage

  1. With Ember-data 2.10 and any Ember version, calling parent.get('child') fails the first time, and calling it a second time resolves the promise (bug)
  2. With Ember-data 2.10 and any Ember version, calling parent.get('children') fails the first time, and calling it a second time resolves the promise (bug)
  3. With Ember-data 2.11.3 or higher and any Ember version, calling parent.get('child') fails the first time, and calling it a second time resolves the promise (bug)
  4. With Ember-data 2.11.3 or higher and any Ember version, calling parent.get('children') fails the first time, and calling it a second time still fails (now fixed, but only for hasMany)

@Leooo
Copy link
Author

Leooo commented Sep 5, 2017

Can someone look at this? Looks like a very big bug to me, is it not (acceptance) tested?

@Leooo
Copy link
Author

Leooo commented Sep 5, 2017

Closing as this bug solved in most recent versions.

@Leooo Leooo closed this as completed Sep 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant