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

Auto tracking regression in +3.28 #427

Open
pjcarly opened this issue Feb 14, 2022 · 15 comments
Open

Auto tracking regression in +3.28 #427

pjcarly opened this issue Feb 14, 2022 · 15 comments

Comments

@pjcarly
Copy link

pjcarly commented Feb 14, 2022

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: emberjs/ember.js#18613 (comment)
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.

@patocallaghan
Copy link
Contributor

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 👍

@pjcarly
Copy link
Author

pjcarly commented Feb 18, 2022

Both at 3.28, I have been trying to reproduce it the entire week, no luck so far. Still investigating.

@pjcarly
Copy link
Author

pjcarly commented Feb 18, 2022

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...

@pjcarly
Copy link
Author

pjcarly commented Feb 24, 2022

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

@ptgamr
Copy link

ptgamr commented Aug 30, 2022

Any updates on this ? We're hitting the same issue on our way to 4...

@knownasilya
Copy link
Collaborator

Have you tried the betas?

@ptgamr
Copy link

ptgamr commented Aug 30, 2022

@knownasilya No I haven't, will try and let you know... Thank you!

@knownasilya
Copy link
Collaborator

@ptgamr did you have luck?

@averydev
Copy link

@knownasilya @ptgamr Any luck here? I'd love to get up to 4!

@VincentMolinie
Copy link
Contributor

There is a new release 6.0.1 that is supposed to support ember-data@3.28+.
Does it work for you @pjcarly ?

@knownasilya
Copy link
Collaborator

I'll be releasing a new patch version today or tomorrow, so watch out for that as well.

@VincentMolinie
Copy link
Contributor

I'm on ember-data-model-fragment@6.0.5 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

@knownasilya
Copy link
Collaborator

@VincentMolinie any chance you can look into it?

@sreeram-cv
Copy link

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?

@VincentMolinie
Copy link
Contributor

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 🤷

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

7 participants