ember-data-model-fragments
ember-data-model-fragments copied to clipboard
Auto tracking regression in +3.28
I have narrowed down a regression in our application to Ember Data Model Fragments, we notice this since upgrading to 3.28 in certain scenarios.
I have tried debugging, but can't seem to figure out where the regression occurs.
It happens in a context the moment we try to call model.get('address')
. Where address is a fragment.
We often see this as a warning, but in some specific scenario's it causes an outright error, crashing the application.
We are seeing this error:
index.js:129 Uncaught (in promise) Error: Assertion Failed: You attempted to update `_tracking` on `Tag`, but it had already been used previously in the same computation. Attempting to update a value after using it in a computation can cause logical errors, infinite revalidation bugs, and performance issues, and is not supported.
Seeing something similar here: https://github.com/emberjs/ember.js/issues/18613#issuecomment-1029901855
And thanks to the explanation of @NullVoxPopuli I kind of understand what is going on. Unfortunately, the solution presented await Promise.resolve();
does not fix the issue.
I will try to create a reproduction application, in the coming days.
Thanks @pjcarly. When you say 3.28 do you mean ember-source or ember-data? But yeah a reproduction of some sort would be good 👍
Both at 3.28, I have been trying to reproduce it the entire week, no luck so far. Still investigating.
All right, I am a small step further, I managed to reproduce the error in a standalone application, it is the combination of this addon, together with ember-data-change-tracker
.
And weirdly it does not occur with data mocked with ember-cli-mirage
, but exact the same data returned with an endpoint, has the issue.
Still investigating...
By using msw.js
instead of ember-cli-mirage
I was able to reproduce the issue in this repository:
https://github.com/pjcarly/autotracking-regression-repro
Any updates on this ? We're hitting the same issue on our way to 4...
Have you tried the betas?
@knownasilya No I haven't, will try and let you know... Thank you!
@ptgamr did you have luck?
@knownasilya @ptgamr Any luck here? I'd love to get up to 4!
There is a new release 6.0.1
that is supposed to support [email protected]+.
Does it work for you @pjcarly ?
I'll be releasing a new patch version today or tomorrow, so watch out for that as well.
I'm on [email protected]
and I had the same issue (before 6.0.0
) but it's working now. I'm still checking but I think this is fixed
@VincentMolinie any chance you can look into it?
I am facing the same issue in our app. using
ember-data-model-fragment: 6.0.5 ember-data: 3.28.13 ember-source: 3.28.12
i do not have ember-data-change-tracker addon as my dependency though. Noticed that removing the defaultValue set for some attributes in the model seem to fix the issue, but unfortunately we need those defaults. any fix/workaround available?
Most of my errors are gone. I saw it once last week if I tried to save a record that has fragment inside, I had to wait for the next run loop and then save my record and in that case it works correctly. But not sure it was linked to ember-data-model-fragments 🤷