-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[BUGFIX beta] Fix createRecord creating two records #5369
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @dwickern! Can you also remove the argument and related code from InternalModel#getRecord
? It's no longer used.
FYI, the CI failure is unrelated to this PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this!
To be clear, this reverts the changes in #4931 which in hindsight were not fully correct. There were still many pathways that would create a model without properties so the reported issue in #4509 was still an issue if you ever used that specific model via normal findRecord
/ findAll
/ etc mechanisms (which I daresay is massively more likely than the cases where the user manually calls .createRecord
).
I believe this is the correct path forward.
@dwickern - I think the issues with master should be resolved, would you mind a rebase? |
6d36767
to
d51e1a2
Compare
@rwjblue I rebased. |
I'm getting this on Ember 2.18.3. I applied this patch locally and it fixed my problem. @rwjblue @mmun any issue with me opening a PR for this same fix on 2.18? Both My component has a reference to the |
@aaronbhansen this fix introduced other regressions, there would be many, many commits necessary to get the complete fix, as each attempt introduced a new regression I'm not sure it is a good idea for us to attempt to backport this one given there is a relatively easy app-side fix:
|
I'll see if that works and update our app code for now. Thanks for the quick response Update: that did fix the issue for anyone that might be experiencing it on 2.18 |
Fixes #5359 and emberjs/ember.js#16258
Explained in #5364:
This applies the workaround from #5359 (comment) to create and cache the record before setting any state which might update inverses.
cc @mmun