-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
[3.1.0] Cannot create new tag for model after its been destroyed error during test teardown #16541
Comments
I think it would be useful to see more of the stack (there are a couple of different pathways that end up calling The thing that seems somewhat odd in this case (and what we need to figure out) is why unwatching would cause |
@rwjblue here is the full stack
|
Gotcha, so its our old friend "the proxy assertion" 😅. My first suggestion (which may need more digging) would be to add a guard here to avoid calculating That might look like: unknownProperty(key) {
if (this.isDestroying || this.isDestroyed) { return; }
let content = contentFor(this);
if (content) {
return get(content, key);
}
}, However, I am also curious what |
I think |
Hmm, I think that should have been addressed by #16404 which I missed when doing 3.1.0 but @rondale-sc backported to release (scheduled for 3.1.1) for us in #16496. Can you test the latest |
I have a feeling I may have trolled us with this issue so for that I apologize. I could have sworn I did try the latest release build this morning and still saw the error. However, in trying to reproduce this against ember master locally I couldn't reproduce it and now that I switch back to the latest release once again I also can't reproduce it. I don't even know which way is up anymore! 😵 Switching back to 3.1.0 release version does exhibit the error so that I think we can consider this resolved and I'll await a new release. |
I'm going to bring this back and say i'm experiencing this but it relies upon ember data also being at the latest version. Interesting thing though is that it takes 3 tries to get it to do it. Check out the video in the attached zip Cannot create a new tag for error.zip My edit route unloads the models loaded in the Versions:
Error:
Here's the full stack:
|
These tests are producing the tag error discussed here: emberjs/ember.js#16541 It looks to involve a rideProxy.distance access… I’m putting it aside for now.
This is a UX change to work around an instance of this error: emberjs/ember.js#16541 Previously, the entire form showed before the user had chosen a ride; now, the user has to choose a ride before the rest of the form shows. I don’t love changing the UX as a workaround for this error, but I couldn’t figure out another way.
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:
|
Seems to work every time with
|
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. |
Just encountered this again on ember 3.19.0. @AlexMayants and @BryanCrotaz fixes appear to have worked. DEBUG: ------------------------------- |
This fixes an error: “cannot create a new tag for (thing) after it has been destroyed” Thanks to the suggestion here: emberjs/ember.js#16541 (comment)
This fixes an error: “cannot create a new tag for (thing) after it has been destroyed” Thanks to the suggestion here: emberjs/ember.js#16541 (comment)
This fixes an error: “cannot create a new tag for (thing) after it has been destroyed” Thanks to the suggestion here: emberjs/ember.js#16541 (comment)
octane version, otherwise autotracking is broken unknownProperty(key) {
if (this.isDestroying || this.isDestroyed) {
return;
}
let content = this.content;
- if (!content || content.isDestroying || content.isDestroyed) {
+ if (content && (content.isDestroying || content.isDestroyed)) {
return;
}
return this._super(key);
}, |
Beginning in Ember 3.1 we have a test that is failing on teardown with this error:
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 laisTrue: readOnly('modelB.someProp')
. WheresomeProp
on model B is anequal
computed.The above assertion seems to be getting triggered during teardown as
ember-metal
tries tounwatch
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.
The text was updated successfully, but these errors were encountered: