[3.1.0] Cannot create new tag for model after its been destroyed error during test teardown
See original GitHub issueBeginning in Ember 3.1 we have a test that is failing on teardown with this error:
Assertion Failed: Cannot create a new tag for
<model-b::ember2555:1>
after it has been destroyed.
Working up a reproduction is going to be hard so I’ll do my best to describe the scenario:
There is a model A that has a belongsTo
relationship with a model B.
Model A also has readOnly
properties that depend on properties in model B a la isTrue: readOnly('modelB.someProp')
. Where someProp
on model B is an equal
computed.
The above assertion seems to be getting triggered during teardown as ember-metal
tries to unwatch
each of the computed properties that depend on some property on the related model. As far as I can tell this does not occur while running the app.
I can make the error go away by either removing these computed properties (not really a solution) or setting the relationship to async: false
.
I’m not sure if this is a regression per se, but I’m also not really sure how to best dig in and figure out how or where to fix this.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:12 (6 by maintainers)
We have encountered the same error as @BryanCrotaz in 3.8.3. I used a modified version of his solution:
It seems to work, but this should probably be fixed within the Ember core.
I’m seeing this in ember 3.8.3.
With @rwjblue 's unknownProperty fix it is intermittent but still happens about 1 in 5 runs.
I built an instance initializer: