ember-data-model-fragments: 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.

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Reactions: 2
  • Comments: 15 (4 by maintainers)

Most upvoted comments

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

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 🤷

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