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

CoreAdminHome.invalidateArchivedReports says it supports range dates in doc but doesn't really support it #9898

Open
tsteur opened this issue Mar 8, 2016 · 2 comments
Labels
Bug For errors / faults / flaws / inconsistencies etc.

Comments

@tsteur
Copy link
Member

tsteur commented Mar 8, 2016

See https://github.com/piwik/piwik/blob/2.16.1-b1/plugins/CoreAdminHome/API.php#L65

The API method says on can use a range date, which is technically true. However, it will simply convert all set dates into range dates. Eg when passing 2016-02-10,2016-02-23 it will invalidate the range dates 2016-02-10,2016-02-10 and 2016-02-23,2016-02-23 which doesn't make any sense since it's simply a single day.

Instead the API should eg require that a number of dates is given that is dividable by 2 numberOfDates % 2 == 0. We can then for example always concatenate two dates to build an actual range date. This is kind of changing API behaviour but current way wouldn't invalidate anything. And in case this is actually wanted we could still on top invalidate each single day as well like it was done before.

@tsteur tsteur added the Bug For errors / faults / flaws / inconsistencies etc. label Mar 8, 2016
@mattab mattab modified the milestones: 2.16.x (LTS), Mid term Mar 31, 2016
@mattab
Copy link
Member

mattab commented Jan 23, 2020

It was maybe implemented in #14450 and #14178
but not sure if it's working still, as i'm not able to make it work.

I tried to invalidate a date range with:./console core:invalidate-report-data --periods=range --sites=1 --dates=2020-01-21,2020-01-22 but it didn't show any output, the command simply returned without error or message.
And after running ./core core:archive the date range Jan 21st-22nd, was still not reprocessed and showed the old reports.

Maybe the feature in #14450 doesn't actually work yet?

@mattab mattab removed this from the Priority Backlog (Help wanted) milestone Jan 23, 2020
@tsteur
Copy link
Member Author

tsteur commented Jan 23, 2020

Not sure what's not working for you. Maybe you want a different feature?

For me it executes these queries:

'UPDATE archive_numeric_2020_01 SET value = 4 WHERE name LIKE \'done%\'
                   AND idsite IN (1)
                   AND ((period = 5 AND ((date2 >= ? AND date1 <= ?))))

You can add --dry-run and get some output.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Projects
None yet
Development

No branches or pull requests

3 participants