-
Notifications
You must be signed in to change notification settings - Fork 47
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
Invalid timestamps: Referrer, Last Order, Forced DateTime, Current TS in Cookie & First Visit #52
Comments
I am trying to assess whether this is a bug or an improvement. I think the test was failing on your machine because of the way the test is written. Because we were not mixing dates with different time zones while doing subtractions I believe timestamps sent to Piwik were correct. Could you help me confirm this? |
Always initalize DateTime in UTC. Fixes #52.
The main culprit for the failing test is DateTime origin = new DateTime(1970, 1, 1, 0, 0, 0, 0);
TimeSpan diff = date - origin; date is |
Would you have an idea why the tests were passing both on travis-ci and on my machine? My machine's time zone is CET. |
I found the reason why tests were not failing on travis-ci nor my machine.
This allowed for a few hours of error. We still have to assess how this was impacting the validity of the data sent to the Piwik server. |
For users using AWS and Azure, default timezone is set to UTC. So no impact for them. If I'm not wrong, for users who had changed the timezone settings and for those who bought Virtual Private Server from their local providers, they probably have timezone set to their local timezone. They would have time of visit reported either too early or too late. For people who live in timezones with daylight savings 👎, it would be a total headache to remedy the data. |
There are many places where
new DateTime(1970, 1, 1, 0, 0, 0)
is used. Some calculation is done with this epoch and then stored in DateTimeOffset. The resulting DateTimeoffset.Offset will be dependent on the timezone settings of the computer.As a result, the test
SetAttributionInfo_WhenReferrerTimestampSpecified_IsAddedToRequest
fails on my computer.Any reason why
new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc)
isn't used?The text was updated successfully, but these errors were encountered: