billysbilling/billy-data — pull request #31 by mex (2014-03-21 12:05:50+00:00)
Title: Adds rollback on delete error

This PR adds running of `record.rollback()`, when a delete command gets an error from the server. The roll back takes care of cleaning the record and setting `isDeleted` to false.

For bulk deleting this will roll back all records included in the delete command. Transaction based APIs will revert all delete operations, if a single one fails, so it makes sense for this to do the same. If this functionality should change, it would make sense to add more logic to `_handleDeleteServerError()`, which could be to check each record ID against `meta.deletedRecords` for the specific type and only roll it back, when it isn't found.

This relates to #30.