-
-
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
Relationship changes #2576
Merged
Merged
Relationship changes #2576
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
} | ||
}, | ||
|
||
syncServer: function() { |
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.
rename to flushCanonical
igorT
force-pushed
the
relationship_changes
branch
3 times, most recently
from
December 13, 2014 01:58
e6385aa
to
6640bfe
Compare
…ent relationship updates This PR makes several changes to relationship handling: 1. It separates the path through which server side and client side updates happen, which lays the ground work for tracking relationship changes. 2. When pushing records into the store, it splits the push process into three phases using a custom runloop: a) Push primary key data and attribtues b) Turn foreign keys into records c) Update relationships The runloop changes have the effect of making pushing relationships at least 50% faster, more if you have more relationships. It also fixes bugs like #2210
igorT
force-pushed
the
relationship_changes
branch
from
December 18, 2014 01:14
6640bfe
to
947bd6a
Compare
igorT
force-pushed
the
relationship_changes
branch
from
December 18, 2014 01:27
947bd6a
to
b1fdb4b
Compare
eccegordo
added a commit
to eccegordo/ed-dupe-bug
that referenced
this pull request
Feb 5, 2015
Change ember data from beta 12 to beta 14.1 Steps to reproduce duplication bug. 1.) start server -> sane up 2.) navigate to http://localhost:4200/post 3.) Click "Add Comment" button couple of times 4.) Click "Delete" button next to each comment and remove all comments 5.) Click "Add Comment" button again. Bug is that when generating a new comment record ember data will reproduce multiple instances of the record and render on screen. The behavior does not appear in ember data vs beta 12. Bug seems to be caused by Ember Data pull request emberjs/data#2576 Relationship changes #2576
igorT
added a commit
that referenced
this pull request
Mar 12, 2015
In #2576 we added a runloop inside ED, in order to handle relationship deserializing and make sure we coalesce hasMany /belongsTo changes. However in that PR we missed the findHasMany call, causing us to trigger a flush(triggering an arrayWill/DidChange) once for every record being parsed. This commit ensures we first process all the records together, and then call flush only once. Was not sure how test this without a super specific unit test.
igorT
added a commit
that referenced
this pull request
Mar 12, 2015
In #2576 we added a runloop inside ED, in order to handle relationship deserializing and make sure we coalesce hasMany /belongsTo changes. However in that PR we missed the findHasMany call, causing us to trigger a flush(triggering an arrayWill/DidChange) once for every record being parsed. This commit ensures we first process all the records together, and then call flush only once. Was not sure how test this without a super specific unit test. fixes #2856
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR makes several changes to relationship handling:
a) Push primary key data and attribtues
b) Turn foreign keys into records
c) Update relationships
The runloop changes have the effect of making pushing relationships at least 50% faster, more if you have more relationships. It also fixes bugs like #2210