TimKJones / CribSpot

2 stars 0 forks source link

Race condition with saving images in PM dash #141

Closed TimKJones closed 11 years ago

TimKJones commented 11 years ago

I add an image. It automatically uploads it, and sets the path in the front end listing object after the fileuploaddone event is triggered. When I click the "Finish" button in the photo editor, it attempts to save the listing. If I've added a photo, but the fileuploaddone event hasn't yet been triggered (because I click "Finish" right after adding it), it attempts to save the listing with an image that isn't complete (image_id is -1, and image_path is an empty string). This needs to make use of a jquery deferred object to make sure both of those events happen and in order, perhaps with a timeout that would signal that something went wrong, and we should abort.

TimKJones commented 11 years ago

fixed with commit 00bb6250b4674f722b7c80458e92446f72eb1924