Skip to content

Backbone 1.0 and Backbone 0.9.10 compatibility difference #46

@rtxanson

Description

@rtxanson

While trying out Backbone.Offline with Backbone 1.0, I uncovered one of the differences. It's nearing the end of the day here, so I won't try to fix and submit a pull request myself, but I thought I'd at least document what I found.

Between 0.9.10 and 1.0, Backbone reverted the API for Backbone.sync success and error callbacks: jashkenas/backbone@6e646f1ba

This this means that with Backbone 1.0, when you run collection.storage.sync.pull(), you get an error such as:

caught TypeError: Cannot use 'in' operator to search for '0' in success 

The problem here of course, is that response ends up being a string "success", not an array of models as the code expects. Unfortunate, because this adds a level of complexity for trying to support both 0.9.10, and 1.0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions