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
Fix incorrect Patch
logic in widget code
#5059
Conversation
|
@ellisonbg I successfully made the changes we talked about in person (9140177), a running buffer of the diff is maintained by us now. |
@jdfreder thanks I will test this later. is there a test to verify this works and that we don't ever send a full On Fri, Feb 7, 2014 at 2:24 PM, Jonathan Frederic
Brian E. Granger |
var return_value = WidgetModel.__super__.set.apply(this, arguments); | ||
|
||
// Backbone only remembers the diff of the most recent set() | ||
// opertation. Calling set multiple times in a row results in a |
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.
'operation'
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!
The test doesn't check to make sure that a full state isn't sent, should I add that test? The test only makes sure that set,set,set,touch works. |
If it is not too much trouble, it would be great to have a test that checks to make sure we don't send full states. That could really kill a widget with a large model. |
Test added! Found a bug in the process 😛 |
|
Nice, I will wait for the tests and then merge. |
Fix incorrect `Patch` logic in widget code
Fix incorrect `Patch` logic in widget code
This does not work in master
instead one has to write
or
because the attr diff is only maintained for the last set operation. This patch fixes this so the first method can be used.