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

fix: prevent You attempted to update _tracking on Tag issue on Ember-data 4.5+ #482

Conversation

VincentMolinie
Copy link
Contributor

@VincentMolinie VincentMolinie commented Dec 12, 2023

I realised we had an issue on, that I reproduce pretty easily in my app with Ember-data 4.6.
The RecordState is registered when we create a new Model.
For a classic native model, the RecordState will be build after all the initial value of the attributes have been set.
But with fragments it's the opposite, the RecordState is build first then the attributes are set which result in a duplicate update of the state

This produce the exact same error that you can find on this issue: #427

My fix is based on the RecordDataDefault, I saw they are using notifyPropertyChange to notify an attribute has change instead of what we are doing which is using notifyStateChange to say the state of the record has changed

@VincentMolinie
Copy link
Contributor Author

VincentMolinie commented Dec 12, 2023

The PR is not ready yet, I'll check why the CI is not passing

@VincentMolinie
Copy link
Contributor Author

Okey it should be good now

@knownasilya
Copy link
Collaborator

Looks like the change is for 4.5+, but you mentioned 4.6, was that a typo?

@VincentMolinie VincentMolinie changed the title fix: prevent You attempted to update _tracking on Tag issue on Ember-data 4.6 fix: prevent You attempted to update _tracking on Tag issue on Ember-data 4.5+ Dec 12, 2023
@VincentMolinie
Copy link
Contributor Author

VincentMolinie commented Dec 12, 2023

Looks like the change is for 4.5+, but you mentioned 4.6, was that a typo?

Yes correct sorry. Because I thought at first it was just 4.6 but you are right it happens also for 4.5

@knownasilya knownasilya merged commit 27d061a into adopted-ember-addons:master Dec 13, 2023
6 of 11 checks passed
@knownasilya
Copy link
Collaborator

Does this solve #427

@VincentMolinie
Copy link
Contributor Author

Does this solve #427

I don't think so as it's related to Ember 3.28. But I actually had the issue on 3.28 but before [email protected]. So this issue might already be fixed anyway

@knownasilya
Copy link
Collaborator

Version released

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

Successfully merging this pull request may close these issues.

2 participants