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
Fix for #5300: prevent email reports from being sent twice #6392
Conversation
The tests are failing but it seems to be the same tests failing on master too: https://travis-ci.org/piwik/piwik/jobs/37238693 (broken for commit 092fda6) |
They started failing in https://travis-ci.org/piwik/piwik/jobs/37159183 but build was still "passing" because that error case did not return error code != 0 until few hours later with 092fda6 |
@@ -177,7 +178,7 @@ public function getReportRecipients(&$recipients, $reportType, $report) | |||
} | |||
|
|||
public function sendReport($reportType, $report, $contents, $filename, $prettyDate, $reportSubject, $reportTitle, | |||
$additionalFiles) | |||
$additionalFiles, Period $period = null, $force) |
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.
maybe $force = false
edit: I see now that it's not required
I amended the commit to address your comments. |
Fix for #5300: prevent email reports from being sent twice
Looks good, well done |
I'm sorry to report I still receive double Alerts. What is different in my case is that one email is English the other one in French. They're loged into the interface : Also, my cronjob is set to every 15 minutes and emails where received with 4 minutes difference : It's no big deal but I wanted to let you know. |
Hi @gaumondp this is a different bug (this issue is about email reports). can you please create new issue? |
Sorry about that, I just openned #7242 |
This is a hotfix for #5300 to prevent email reports from being sent more than once.
Now each time a report is sent, the last "period" it was sent for will be stored in the Option table. Before sending a report, we check if we have already sent a report for the same period.
If the report is sent manually through the web interface, a
force
parameter is set totrue
, which means that the whole "prevent from sending it twice" thing is ignored.