reverbdotcom / reverb-magento

Magento 1.x plugin for syncing with Reverb
Other
7 stars 10 forks source link

Failed update tasks - why not create? #251

Closed skwp closed 8 years ago

skwp commented 8 years ago

This is a decision we made a long time ago but I want to revisit this, @dunagan5887 . If an order update task fails due to the order creation task not having completed for any reason, can we just try to create the order at the time of update? I'd rather there be a meaningful error in the update screen than "Reverb Order with id 1094 has not been created in the Magento system yet".

skwp commented 8 years ago

In general, it may make sense to have the system poll on updated orders only, forgetting the creation polling entirely since if an order was created at a particular time then its updated stamp will also be at the same time and should be caught by the same process. That could simplify the order sync system.

dunagan5887 commented 8 years ago

Are all data points which are necessary to create an order included in the order update API response? If the issue is the error message, I can just have the task be set back to Pending until the order is created

kylecrum commented 8 years ago

@dunagan5887 yes, it should actually be the same data.

What we're advocating is only polling for updates and then always doing upserts with that data. If the order exists, update it, if it does not, then create it. The issue isn't just the error message, it seems like the issue is that we will poll the updates and get an update before we poll the creates. We've introduced a race condition that we probably don't need.

dunagan5887 commented 8 years ago

So if the order creation fails, the error message would be displayed on the order update task, correct?

kylecrum commented 8 years ago

I believe so.

dunagan5887 commented 8 years ago

This will take around 4-8 hours. Should I begin now?

dunagan5887 commented 8 years ago

This update will also rename the "Order Creation and Shipment Tracking" screen to just be "Shipment Tracking"