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

Upgrade from 1.13.8 to 1.13.11 breaks our app #3769

Closed
tschoartschi opened this issue Sep 15, 2015 · 4 comments
Closed

Upgrade from 1.13.8 to 1.13.11 breaks our app #3769

tschoartschi opened this issue Sep 15, 2015 · 4 comments

Comments

@tschoartschi
Copy link

Basically we display a catalog with tags and items. Therefore we fetch the data with ember-data and render it. With ember-data 1.13.8 everything worked fine but after an upgrade to 1.13.11 our catalog is broken. The strange thing is, it only effects some items. The effected items have the property type with value "configuration" (which is returned as as string from the server but is is a belongsTo relation). The model definitions look as follows:

The catalog model: app/models/catalog.js

export default DS.Model.extend({
    // some proprties, which are strippe due to readability
    // Relationships
    tenant: DS.belongsTo('tenant', {async: true}),
    items: DS.hasMany('item', {async: true}),
    allItems: DS.hasMany('item', {async: true, inverse: null}),
    components: DS.hasMany('component', {async: true}),
    materials: DS.hasMany('material', {async: true}),
    tags: DS.hasMany('tag', {async: true}),
    allTags: DS.hasMany('tag', {async: true}),
    rootTags: DS.hasMany('tag', {async: true}),
});

The item model: app/models/item.js

export default DS.Model.extend({
    // some proprties, which are strippe due to readability
    hidden: DS.attr('boolean'),
    sort: DS.attr('number'),

    // Relationships
    catalog: DS.belongsTo('catalog', {async: true, inverse: null}),
    detailType: DS.belongsTo('detailType', {async: true, inverse: null}),
    type: DS.belongsTo('objectType', {async: true, inverse: null}),
    tags: DS.hasMany('tag', {async: true, inverse: null})
});

The tag model: app/models/tag.js

export default DS.Model.extend({
    // some proprties, which are strippe due to readability
    // Relationships
    catalog: DS.belongsTo('catalog', {async: true, inverse: null}),
    tags: DS.hasMany('tag', {inverse: null}),
    parents: DS.hasMany('tag', {inverse: null}),
    items: DS.hasMany('item', {async: true, inverse: null}),
});

At first we fetch the catalog, then we iterate over the tags of the catalog and then we fetch all items belonging to each tag. Everything works fine, except items which have a type configuration, these items don't have any properties, only the id is set. So we can not access properties like sortor hidden. Until version 1.13.8 of ember-data we had no issues and every property was available (also on items with type === "configuration"). Downgrading from 1.13.11 to 1.13.8 fixes this issue but I don't like the idea that we can not update anymore. Did we discovered some edge case in ember-data or is it just some misconfiguration from our side?

We use ember-cli 1.13.8 with ember 1.13.10 and we want to use ember-data 1.13.11 or .12. Right now we can just use ember-data 1.13.8.

If you need more information to track down this problem, let me know.

All the best
Tschoartschi

@tschoartschi
Copy link
Author

@rwjblue okay thanks for your quick reply. Do you need more information or is it ok for now?

@bmac
Copy link
Member

bmac commented Sep 15, 2015

Hi @tschoartschi. It looks like #3725 should solve this issue. That pr was included in 1.13.12. Do you mind upgrading to that version and letting us know if it fixes your issue?

@tschoartschi
Copy link
Author

@bmac version 1.13.12 seems to fix the issue. I thought that I tried it before opening this issue but maybe I forgot to upgrade the version in package.json or bower.json. I don't know. Most importantly it works again 👍 thanks for all your efforts!

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

3 participants