You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
mgazdzik opened this issue
Jun 17, 2014
· 3 comments
Assignees
Labels
BugFor errors / faults / flaws / inconsistencies etc.MajorIndicates the severity or impact or benefit of an issue is much higher than normal but not critical.
In (1) timezone is being only passed to Period factory (2) when it's not range (so day,week,month,year, single date). If we take date range (startDate,endDate), period = range, or use lastN/previousN the timezone is not being passed to factory.
This causes reporting to show next day relatively to site timezone, even though current day hasn't ended.
To fix that - simply we need to pass timezone string taken from Site object, to Period/Factory where new Range() is being created.
The text was updated successfully, but these errors were encountered:
When reporting a bug, it would be super helpful if you also report the steps you used to reproduce this issue in an isolated way.
Steps to reproduce are important to help trouble shoot the issue, but also we need steps to know how to write a test case (since test case usually closely matches steps to reproduce).
I tried to reproduce the issue as follows:
Create website with timezone New York
In NY timezone, the day is still June 17th. It is June 18th in UTC.
I track a visit in that website in June 18th UTC / June 17th in NYC timezone
requesting: index.php?module=API&method=VisitsSummary.get&idSite=1&period=day&date=2014-06-17,today&format=xml
I get this response:
As for reproducing in isolated test case - I think steps should be quite the same.
build archive for site with different timezone than UTC,
try to pull out timezone for generated subperiods,
check if they match with site's timezone.
This test should cover all cases, in which Period::factory will be using Range class, so it would be period=range, lastX, previousX, or date spans like 2014-06-19,2014-06-20 (possibly there will be more cases ?).
Just to clarfy - actual problem is with time-shift between proper midnights in different timezones, can cause for ex. situation when it's 2014-06-20 before midnight of New York time (while it's after midnight in UTC) , user querying for date = 2014-06-18,today will recieve data including 2014-05-20 .. which hasn't actually started in timezone of site.
Hope this makes this issue reproduceable and easier to solve.
Please let me know if I can provide any more help with this ?
BugFor errors / faults / flaws / inconsistencies etc.MajorIndicates the severity or impact or benefit of an issue is much higher than normal but not critical.
There is bug in Archive::build() method.
(1) https://github.com/piwik/piwik/blob/master/core/Archive.php#L201
(2) https://github.com/piwik/piwik/blob/master/core/Period/Factory.php#L35
In (1) timezone is being only passed to Period factory (2) when it's not range (so day,week,month,year, single date). If we take date range (startDate,endDate), period = range, or use lastN/previousN the timezone is not being passed to factory.
This causes reporting to show next day relatively to site timezone, even though current day hasn't ended.
To fix that - simply we need to pass timezone string taken from Site object, to Period/Factory where new Range() is being created.
The text was updated successfully, but these errors were encountered: