What if the Slack host isn't available or there is a routing problem to the Slack server? The customer will get annoyed because the frontend loads to slow or any other Slack related error ouccurs. The store owner loses money.
For example: move this messaging service into a cronjob and use a 3rd table (three columns: entity_type, entity_id, sent) to check if the order/customer/etc has already been reported.
Cool idea! :+1:
But ... as far as I can see here (https://github.com/mhauri/magento-slack/blob/master/app%2Fcode%2Fcommunity%2FMhauri%2FSlack%2FModel%2FObserver.php#L54) all requests to Slack happens synchronously.
What if the Slack host isn't available or there is a routing problem to the Slack server? The customer will get annoyed because the frontend loads to slow or any other Slack related error ouccurs. The store owner loses money.
For example: move this messaging service into a cronjob and use a 3rd table (three columns: entity_type, entity_id, sent) to check if the order/customer/etc has already been reported.
Or: Store the generated JSON (e.g. https://github.com/mhauri/magento-slack/blob/master/app%2Fcode%2Fcommunity%2FMhauri%2FSlack%2FModel%2FObserver.php#L44) in a Redis instance (or DB table) and then => cronjob. The classical messaging queue.
:blush: