Skip to content
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

Merged
merged 2 commits into from Oct 7, 2014

Conversation

mnapoli
Copy link
Contributor

@mnapoli mnapoli commented Oct 6, 2014

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 to true, which means that the whole "prevent from sending it twice" thing is ignored.

@mnapoli mnapoli added this to the Piwik 2.8.0 milestone Oct 6, 2014
@mnapoli
Copy link
Contributor Author

mnapoli commented Oct 7, 2014

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)

@mattab
Copy link
Member

mattab commented Oct 7, 2014

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)
Copy link
Member

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

@mnapoli
Copy link
Contributor Author

mnapoli commented Oct 7, 2014

I amended the commit to address your comments.

@mattab mattab added the duplicate For issues that already existed in our issue tracker and were reported previously. label Oct 7, 2014
mattab pushed a commit that referenced this pull request Oct 7, 2014
Fix for #5300: prevent email reports from being sent twice
@mattab mattab merged commit 20ab533 into master Oct 7, 2014
@mattab
Copy link
Member

mattab commented Oct 7, 2014

Looks good, well done

@mnapoli mnapoli deleted the bugfix/5300 branch October 7, 2014 03:43
@gaumondp
Copy link

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 :

image

Also, my cronjob is set to every 15 minutes and emails where received with 4 minutes difference :

image

It's no big deal but I wanted to let you know.

@mattab
Copy link
Member

mattab commented Feb 18, 2015

Hi @gaumondp this is a different bug (this issue is about email reports). can you please create new issue?

@gaumondp
Copy link

Sorry about that, I just openned #7242

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate For issues that already existed in our issue tracker and were reported previously.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants