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 inspector fails to inspect model when enableIsDirty is set #47

Open
kltdwrds opened this issue May 2, 2018 · 3 comments
Open

Comments

@kltdwrds
Copy link

kltdwrds commented May 2, 2018

config:
changeTracker: { trackHasMany: true, auto: true, enableIsDirty: true }

attempting to inspect a model renders:

You can report bugs at https://github.com/emberjs/ember-inspector.
Error message: Assertion Failed: You attempted to access `hasDirtyAttributes.type` (on `<safechain-ops-ui@model:order::ember635:gy1m2Zv>`), but `hasDirtyAttributes` is a computed property.

Due to certain internal implementation details of Ember, the `hasDirtyAttributes` property previously contained a private "descriptor" object, therefore `hasDirtyAttributes.type` would have been `undefined`.

This implementation detail has now changed and the "descriptor" object is no longer present at this location. Soon, accessing `hasDirtyAttributes` on this object will return the computed property's current value (see RFC #281 for more details).

If you are seeing this error, you are likely using an addon that relies on this now-defunct private implementation detail. If you can, identify the addon from the stack trace below and report this bug to the addon authors. If you feel stuck, the Ember Community Slack (https://ember-community-slackin.herokuapp.com/) may be able to offer some help.

If you are an addon author and need help transitioning your code, please get in touch in the #dev-ember channel in the Ember Community Slack.
Stack trace: Error: Assertion Failed: You attempted to access `hasDirtyAttributes.type` (on `<safechain-ops-ui@model:order::ember635:gy1m2Zv>`), but `hasDirtyAttributes` is a computed property.

Due to certain internal implementation details of Ember, the `hasDirtyAttributes` property previously contained a private "descriptor" object, therefore `hasDirtyAttributes.type` would have been `undefined`.

This implementation detail has now changed and the "descriptor" object is no longer present at this location. Soon, accessing `hasDirtyAttributes` on this object will return the computed property's current value (see RFC #281 for more details).

If you are seeing this error, you are likely using an addon that relies on this now-defunct private implementation detail. If you can, identify the addon from the stack trace below and report this bug to the addon authors. If you feel stuck, the Ember Community Slack (https://ember-community-slackin.herokuapp.com/) may be able to offer some help.

If you are an addon author and need help transitioning your code, please get in touch in the #dev-ember channel in the Ember Community Slack.
    at new EmberError (http://localhost:4200/assets/vendor.js:28634:25)
    at Object.assert (http://localhost:4200/assets/vendor.js:28877:15)
    at Object.get (http://localhost:4200/assets/vendor.js:38317:42)
    at addProperties (<anonymous>:3145:40)
    at mixin.mixins.forEach.mixin (<anonymous>:3116:11)
    at Array.forEach (<anonymous>)
    at propertiesForMixin (<anonymous>:3114:20)
    at Class.mixinsForObject (<anonymous>:3004:22)
    at Class.sendObject (<anonymous>:2923:26)
    at Class.inspectModel (<anonymous>:740:37)
@danielspaniel
Copy link
Owner

Thanks for reporting this error, but without more context, I can not recreate it.
One of the keys to fixing something is to see it breaking, and I updated change tracker to 3.1 everything and did not see this ( and I set a model to those settings for change tracker ).
Can you make a PR on change tracker and show the error, or show the error in a twiddle?

@kltdwrds
Copy link
Author

kltdwrds commented May 4, 2018

@danielspaniel thanks for the reply, and thanks for the great add-on! To clarify, the config mentioned above is set at the application lvl (not just a specific model).

I'll attempt to recreate in an twiddle app soon. I can confirm however, that between consecutive builds on my project, with enableIsDirty: true being the only difference, this error rendered on inspection of any model.

Thanks again!

@danielspaniel
Copy link
Owner

You're using ember / ember-data 3.1 right?

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

2 participants