You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@sandangel
hi i'll write here what i wrote in dinvlad pr, as the pr was closed before anyone could address it.
as opposed to the simple update case, where perhaps we pass an object id and a change and can assume there is a change,
in upsert we'll porobably pass a list of full-blown objects to either be added if missing or updated if exists.
in such case, we might add objects that exists and do not need any update because they are exactly the same as they were before.
i went over your code, and just like in dinvlad's pr -
in the current implementation what would happen is that the objects will be updated, thus assigned a new reference. this would cause them, given angular's change detection on-push strategy, to reload into the page.
hi @shahafal
What you want to address does not relate to my PR, it relates to update methods. upsert methods is just detect whether id in entities and call addMany, updateMany accordingly.
@sandangel
you are right that this is a performance issue that actually effects the update method,
however,
when you do a regular update you specify a change you want to make, which means you are more likely to pass a real change and not the same data.
and this brings me to why i think it is related to your pr too -
due to the fact that you'd expect upsert to get list of full blown entities that might not necessarily contain changes in them
This file contains hidden or 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
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 continue some works of @dinvlad , include some fix:
Refs: #550
Closes: #421