Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I'll use this issue to submit a patch that works with mailchimp version 8.x
Comment | File | Size | Author |
---|---|---|---|
#14 | interdiff_12-13.txt | 1.79 KB | brendanthinkshout |
#14 | mailchimp-retry_failed_communications-3029438-13.patch | 1.81 KB | brendanthinkshout |
| |||
#12 | 3029438-12.patch | 1.59 KB | casey |
| |||
#11 | 3029438-11.patch | 1.17 KB | casey |
| |||
#10 | interdiff-3029438-7-10.txt | 793 bytes | aprice42 |
Comments
Comment #2
karstenkmadsen CreditAttribution: karstenkmadsen commentedFirst of all: This module it really great. Great work guys.
This patch will fix the problem that rooby describes in parent issue.
To ad unsubscribe to the queue when the connection is off, I had to move the mailchimp_is_subscribed test down in the mailchimp_unsubscribe_process, to me this seems to be the correct solution. But I am wery open to feedback.
Comment #3
rjacobsen0 CreditAttribution: rjacobsen0 at ThinkShout for Mailchimp commentedGreat! Nice patch! Would be nice to know how to reproduce the issue. @karstenkmadsen, Do you have a use case?
Comment #4
karstenkmadsen CreditAttribution: karstenkmadsen commentedUse case:
1) Add a new user in drupal "and run cron", check in mailchimp that it got created there too.
2) alter the api-key to an invalid key, delete the user "and run cron". The user should now still be in the mailchimp list because the connection is broken.
3) alter the api-key back to the valid api-key "and run cron". With the patch installed the user should be deleted from mailchimp now. If the Patch is not installed mailchimp and drupal will be out of sync there.
Keep an eye in DB on the table "queue". Without the Patch: queue items get deleted even though the connenction to mailchimp is broken, thereby sync gets broken.
Karsten
Comment #5
rooby CreditAttribution: rooby commentedI would say this is actually a bug, since it is a case of lost data when there is a broken transmission.
It's probably major, due to:
Patch still applies cleanly to latest dev.
Comment #6
samuel.mortensonComment #7
aprice42 CreditAttribution: aprice42 at ThinkShout for Mailchimp commentedRe-rolled patch with the latest from 8.x-1.x.
Comment #8
aprice42 CreditAttribution: aprice42 at ThinkShout for Mailchimp commentedThis patch is not able to be tested without the patch from https://www.drupal.org/project/mailchimp/issues/3073887
Comment #9
aprice42 CreditAttribution: aprice42 at ThinkShout for Mailchimp commentedThis is working as outlined in #4 above.
Comment #10
aprice42 CreditAttribution: aprice42 at ThinkShout for Mailchimp commentedI noticed something with this patch while working on another issue. This patch fixes the unintended reintroduction of some variables in
mailchimp_unsubscribe()
. It also fixes a minor coding standard issue.Comment #11
casey CreditAttribution: casey at SWIS commentedWe've encountered that you can't keep failed items on the queue as that would result in the queue runner only retrying failing items. We also can't move failed item to the back of the queue as the order of the queue (for items regarding the same email address) is important.
Attached patch retries failed items once, immediately after failure. If it fails again, the item is moved to a separate "mailchimp_failed" queue for manual inspection.
This probably is not a final fix, but at least gives us some slack to find a better solution.
Comment #12
casey CreditAttribution: casey at SWIS commentedForgot to merge with patch from #10
Comment #13
aprice42 CreditAttribution: aprice42 at ThinkShout for Mailchimp commentedComment #14
brendanthinkshout CreditAttribution: brendanthinkshout at ThinkShout for Mailchimp commentedI really like the failed queue approach, @casey, but I think in the case of API outages, it's better to retry the next time a batch is processed instead of right away. I'd also like to specify a limited number of retries in a constant. What I'm not clear on is how this will behave with the queue ordering issues you mentioned. Do you have an example of how trying to process items with the same email address might go awry if one is pushed to the back of the queue?
Comment #15
gcb