-
-
Notifications
You must be signed in to change notification settings - Fork 436
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ensure there are no emails without recipient in email queue #1109
Ensure there are no emails without recipient in email queue #1109
Conversation
…invalid emails without recipient in queue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -238,13 +238,13 @@ public function send() | |||
|
|||
try { | |||
$mailer->send(); | |||
unset($mailer); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why move the unset?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the unset
comes from line 245 https://github.com/OpenMage/magento-lts/pull/1109/files#diff-e408845a99067b7da8df6e1c971d74dd81e8d02f15b4b6111ce1d4389ae45e49L245
@@ -238,13 +238,13 @@ public function send() | |||
|
|||
try { | |||
$mailer->send(); | |||
unset($mailer); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the unset
comes from line 245 https://github.com/OpenMage/magento-lts/pull/1109/files#diff-e408845a99067b7da8df6e1c971d74dd81e8d02f15b4b6111ce1d4389ae45e49L245
Unit Test Results1 files 1 suites 0s ⏱️ Results for commit e286008. |
The move of the unset is wrong no? magento-lts/app/code/core/Mage/Core/Model/Email/Queue.php Lines 239 to 247 in 3005c60
On exception, variable is not unset. |
@luigifab - the author can tell us why he moved in exception. Maybe it was better to leave it where it was before. |
Agreed with the change overall. Not sure if the location of the unset matters much, the PHP garbage collector should be able to clean it up either way I think. |
i think the whole solution does not work nor is well tested - remove an recipient and the queue processing is brought to an end:
This was happening first time on a store running since 10 years with 1k plus oders a day. We never had problems until today. We should better quality test code changes, because i have the feeling quality is going down. |
@leissbua Sorry for the problem you face. How do you remove a recipient? Was it the first recipient that was removed? Does it throw the exception when the second or third recipient is removed? |
Additional check of email recipients in order to ensure there are no invalid emails without recipient in queue
Description (*)
It appeared several times that there are emails without recipients in the emails queue - even if the email address is mandatory for checkout. This pull request is not fixing the origin issue but it ensures that this one wrongly added email is not blocking all queued emails which is leading to unsatisfied customers.
Consider it more as a security improvement to keep the shop running.
Manual testing scenarios (*)
There is no known test scenario but it is solving issues that happens once every 2000 orders.
Contribution checklist (*)