jashkenas / backbone

Give your JS App some Backbone with Models, Views, Collections, and Events
http://backbonejs.org
MIT License
28.1k stars 5.39k forks source link

error event not firing for Collection.create with wait true #4262

Closed alanhamlett closed 1 year ago

alanhamlett commented 1 year ago

For Collection.create, the sync and add events fire correctly, but if options are {wait: true} and server responds with any error, the error event doesn't fire. Without {wait:true} the error event fires correctly, but the invalid model is added to the collection.

jgonggrijp commented 1 year ago

if options are {wait: true} and server responds with any error, the error event doesn't fire.

This is certainly surprising (especially since the wait option should only affect addition, judging by the source code). I will look into it.

Without {wait:true} the error event fires correctly, but the invalid model is added to the collection.

This is as intended and as advertised.

recursivk commented 1 year ago

Any updates on the resolution?

jgonggrijp commented 1 year ago

@recursivk I secured two full-time weeks to work on Backbone, starting next week. The high priority issues, including this one, will be addressed first.

recursivk commented 1 year ago

Thanks, that helps a lot

On Thu, Jul 13, 2023 at 4:01 AM Julian Gonggrijp @.***> wrote:

@recursivk https://github.com/recursivk I have two full-time weeks to work on Backbone, starting next week. The high priority issues, including this one, will be addressed first.

— Reply to this email directly, view it on GitHub https://github.com/jashkenas/backbone/issues/4262#issuecomment-1633290981, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALFG2CHGC6Z4TSQG54LQMUTXP4QSRANCNFSM6AAAAAAUAHKRVU . You are receiving this because you were mentioned.Message ID: @.***>