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

Don't notify relationships with links during initialization #5119

Merged
merged 1 commit into from
Aug 10, 2017

Conversation

mmun
Copy link
Member

@mmun mmun commented Aug 9, 2017

@@ -346,7 +346,7 @@ export default class Relationship {
this.store._updateRelationshipState(this);
}

updateLink(link) {
updateLink(link, initial) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where is this true ?

Copy link
Member Author

@mmun mmun Aug 9, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/emberjs/data/blob/master/addon/-private/system/relationships/state/create.js#L72

Furthermore, this line and the one in my PR are the only two places that call Relationship#push in the test suite.

Copy link
Contributor

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

@mmun
Copy link
Member Author

mmun commented Aug 10, 2017

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

"ember-data": "emberjs/data#bugfix/4942",

@tsteuwer
Copy link

Will try in the morning on our apps.

@stefanpenner
Copy link
Member

Fix looks good. But we will need a test or two

@mmun
Copy link
Member Author

mmun commented Aug 10, 2017

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.

@rtablada
Copy link
Contributor

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

@aureliosaraiva
Copy link

aureliosaraiva commented Aug 10, 2017

@mmun Very nice!

Copy link

@aureliosaraiva aureliosaraiva left a 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.

@stefanpenner
Copy link
Member

stefanpenner commented Aug 10, 2017

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

@mmun
Copy link
Member Author

mmun commented Aug 10, 2017

@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]?

@mmun
Copy link
Member Author

mmun commented Aug 10, 2017

@stefanpenner Tests added. I confirmed that they fail before the fix is applied.

@stefanpenner
Copy link
Member

BTW, should I label this for [BUGFIX release]?

👍

@stefanpenner stefanpenner merged commit 171102c into master Aug 10, 2017
@stefanpenner
Copy link
Member

stefanpenner commented Aug 10, 2017

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.

@stefanpenner stefanpenner deleted the bugfix/4942 branch August 10, 2017 05:59
@rlivsey
Copy link

rlivsey commented Aug 10, 2017

Just checked my app against master and can confirm this fixes the issues I was seeing in #4942

Awesome stuff, thank you everyone!

@buschtoens
Copy link
Contributor

Thank you so much! This was blocking our upgrades for weeks. ♥️

@bmac
Copy link
Member

bmac commented Aug 10, 2017

I've released v2.14.10 and v2.15.0-beta.4 with this bugfix.

@stefanpenner
Copy link
Member

stefanpenner commented Aug 10, 2017

@mmun thanks for the fix, @bmac thanks for cutting the release.

My apologies to those affected by this, and how long it took to address.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
9 participants