-
-
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
Don't notify relationships with links during initialization #5119
Conversation
@@ -346,7 +346,7 @@ export default class Relationship { | |||
this.store._updateRelationshipState(this); | |||
} | |||
|
|||
updateLink(link) { | |||
updateLink(link, initial) { |
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.
where is this true
?
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.
Furthermore, this line and the one in my PR are the only two places that call Relationship#push
in the test suite.
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.
oooooh, that this arg was already present implies that at some point we'd thought of this case and lost it
I tried it out on someone's example app and it fixed the bug: #5023 (comment). I'd still like if other users could confirm this fix works for them. If someone would like to try it out in their app, just change your ember-data dependency in package.json to
|
Will try in the morning on our apps. |
Fix looks good. But we will need a test or two |
Hmm... I'm not sure of the right way to test this. The problematic assertion is very coupled to rendering so I guess we can write a regression test via a component integration test. |
@mmun if you want to pair a bit on testing it, I've got some time tomorrow and I'm definitely interested in getting more involved in the E-D side of things. |
@mmun Very nice! |
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.
I tested in my apps and solves the problem.
@mmun there is an observable difference re: change notifications, so a isolated test with some strategically placed listeners (cp dk's or observers) should do the trick in isolation, outside of rendering. |
@stefanpenner Hmm for some reason I thought there wouldn't be change notifications in this case but I'll try that first. BTW, should I label this for [BUGFIX release]? |
@stefanpenner Tests added. I confirmed that they fail before the fix is applied. |
👍 |
Let's see how those CI runs go, if they are good we should cut releases. @bmac if they are green, and you happen to have cycles. I would love a hand shipping them. If not, I can likely handle shipping them late tomorrow night. going to sleep now, see you all in the morning. |
Just checked my app against master and can confirm this fixes the issues I was seeing in #4942 Awesome stuff, thank you everyone! |
Thank you so much! This was blocking our upgrades for weeks. |
I've released v2.14.10 and v2.15.0-beta.4 with this bugfix. |
Fixes #4942.
Fixes #5023.
Fixes #5017.
I also took the liberty of changing https://github.com/emberjs/data/compare/bugfix/4942?expand=1#diff-fd4c34d9a34dfde73cd3413128a3c973L2876 to be more explicit.
If this change is approved, we should reach out to people linking to this issue after a release is cut.