D5672: always use UTC timestamp for PimItem datetime and atime

Daniel Vrátil noreply at phabricator.kde.org
Wed May 3 10:02:05 BST 2017


dvratil added a comment.


  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.

INLINE COMMENTS

> protocol.cpp:797
>      QDebug dbg(_dbg.noquote());
> -    return dbg << "Item" << item.id << "(RID:" << item.remoteId
> +    return dbg << "Item:" << item.id << "(RID:" << item.remoteId
>                 << ", RREV:" << item.remoteRevision << ", mimetype: " << item.mimeType;

This seems to have sneaked its way into multiple of your reviews :-) Commit it separately, please.

REPOSITORY
  R165 Akonadi

REVISION DETAIL
  https://phabricator.kde.org/D5672

To: mkoller, dvratil
Cc: #kde_pim, dvasin, ach, winterz, vkrause, mlaurent, knauss, dvratil
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20170503/7f365b85/attachment.html>


More information about the kde-pim mailing list