noveogroup / backbone.iobind

Bind socket.io events to backbone models & collections. Also includes a drop-in replacement for Backbone.sync using socket.io.
https://noveogroup.github.io/backbone.iobind/
582 stars 65 forks source link

Exceeding number of args passed in success() #33

Closed chaobin closed 11 years ago

chaobin commented 11 years ago

In line 77 of backbone.iosync.js, 'if (success) success(model, resp, options);' passes three arguments to the success(), this will cause the local model instances fail to update themselves.

If you look at backbone.js, line 430, 'options.success = function(resp) {' only takes one argument, that is the response object from server.

I ran into a situation that lead me to this problem after one of our developer introduced a different version of backbone.iobind.

xiaods commented 11 years ago

a commit will help understand.

mahnunchik commented 11 years ago

https://github.com/logicalparadox/backbone.iobind/commit/5ee3e7aa1f1f625c4b6595b6f9d3ccd0c06e59af - compatibility fixes