After a quick look at the code it seems like this module will try to send data to Mailchimp and if that communication fails for any reason then that data is just lost.
For example in mailchimp_cron() it has this:
<?php
if ($item = $queue->claimItem()) {
call_user_func_array($item->data['function'], $item->data['args']);
$queue->deleteItem($item);
}
?>
Shouldn't it be something like this (note that this is nonsense code to illustrate my point, not working code)?:
<?php
if ($item = $queue->claimItem()) {
$result = call_user_func_array($item->data['function'], $item->data['args']);
// If the Mailchimp communication was successful then delete the item from the queue.
// Otherwise the item will stay in the queue and will be tried again later.
if ($result->success) {
$queue->deleteItem($item);
}
}
?>
So that if something fails then it tries again later so you don't get lost data?
If something continually fails it's up to the admin to address those failure messages.
Also this module could potentially provide a list of items that have failed more than once or something.
It would be also good to have this built into instant communications (when variable_get('mailchimp_cron', FALSE) == TRUE) so that if the instant transaction fails then it is added to the cron queue.
This whole re-try thing could be a configuration option that can be disabled if anyone didn't want it for some reason.
Comments
Comment #1
angel.angelio CreditAttribution: angel.angelio commented+1
Comment #2
helmo CreditAttribution: helmo at Initfour websolutions commentedGood idea. I had just added a number of related issue to #2375119: Error opening socket ssl://us2.api.mailchimp.com:443 put back in the queue when I found this.
Hope someone finds the time to do it.
Comment #3
ruscoe CreditAttribution: ruscoe at ThinkShout for Mailchimp commentedWe're going to be ending support for the 7.x-3.x branch due to the upcoming deprecation of the v2.0 MailChimp API. If you're still interested in this feature, please feel free to reopen for the 7.x-4.x branch.
Comment #4
rooby CreditAttribution: rooby commentedBased on a quick look at the code it seems my code snippets in the original post are still relevant.
Definitely still interested in this as it is a pretty important feature.
Comment #5
Greg BoggsFeel free to create a patch with your code if you're interested in getting this feature added to MailChimp. Here's more information: https://www.drupal.org/node/707484
Comment #6
samuel.mortensonWe’re in maintenance-mode for the Drupal 7 releases of Mailchimp, so only bug fixes can be committed going forward. Any new features should be developed for the Drupal 8 releases of Mailchimp. Thanks!
Comment #7
rooby CreditAttribution: rooby commentedAlthough I was the person who originally filed this as a feature request, I have no idea why I would have done so.
I would say this is definitely a bug, since it is a case of lost data when there is a broken transmission. Sites could be unknowingly missing out on mailing list subscribers.
It's probably major, due to:
This is still valid for the 5.x branch.
There is a patch in the related ticket for the D8 branch, which once committed could be used for back-porting.