kathyisawesome / woo3pdhelpscout

Parse WooCommerce.com support emails into HelpScout conversations
5 stars 0 forks source link

Skip or retry creating customer when response is 409 conflict #15

Closed helgatheviking closed 4 years ago

helgatheviking commented 4 years ago

I've added a delay to try to allow HS to create the customer on the original email before trying to create a new customer.

But it may still not be long enough. Another approach might be to try/catch the customer creation. If you get a 409 conflict

Client error: POST https://api.helpscout.net/v2/customers resulted in a 409 Conflict response: {"logRef":"eab45a81-90a1-4f40-8a61-7b7dc0c43981#336477607","message":"Conflict - entity cannot be created","_embedded":{

This means that the customer already exists and we should catch the exception gracefully so we can try again to fetch the customer ID and keep processing.

Preciousomonze commented 4 years ago

πŸ₯³πŸ₯³πŸ₯³πŸ₯³ Darling is on fireeπŸ”₯πŸ”₯ WooCommerce sageπŸ™‡πŸ½β€β™‚οΈ At your service πŸ„πŸ½β€β™‚οΈ

helgatheviking commented 4 years ago

Lol... I feel the absolute opposite of "on fire" today. Just logging lots of bugs and not fixing things.

Preciousomonze commented 4 years ago

πŸ˜‚πŸ˜‚ still something, keeping record.