There were some inconsistent usages of QDateTime::currentDateTime() and QDateTime::currentDateTimeUtc()
Sometimes items in the DB ended up having local time, most of them UTC (I mainly saw local time on these which had the empty-RID problem).
This patch now uses always UTC
Details
Diff Detail
- Repository
- R165 Akonadi
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
Thanks!
There is one more place that you could fix just for the sake of semantics: in akonadidb.xml we use QDateTime::currentDateTime() to represent the default value of some columns, you could change that to currentDateTimeUtc() too, and then adjust the code in DbInitializer::sqlValue() accordingly. The "QDateTime::currentDateTime()" here is not executed anywhere, it's only used as a string to represent what the default value is going to be.
An interesting thing to look into could be writing a test to make sure that we correctly process the datetime returned from each database to be in UTC. In the past, there were issues that SQL returned the datetime in UTC, while MySQL in local time without timezone, not sure what PSQL did. I tried to normalize all of these (see Utils::variantToDateTime()) beut it's only used for the generated Entities, not in regular SQL queries. But that's completely out-of-scope fo this change and will probably require a bit of work.
src/private/protocol.cpp | ||
---|---|---|
797 ↗ | (On Diff #14035) | This seems to have sneaked its way into multiple of your reviews :-) Commit it separately, please. |