Deduce a timezone for tasks due and start date

Authored by mollekopf on Nov 18 2020, 11:07 PM.



Activesync doesn't know about timezones, but submits a utc and non-utc
value. We attempt to preserve this information by matching a timezone
with the same offset, so we can can replay a task with the same values
to another client.
If we don't do this the time will be stored as utc, and we will end up
replaying utcDueDate == dueDate, which will result in the client
displaying the task with an offset of the utc offset.
This solution will break down with clients in different timezones, but
that's just how it is unless we find a way to detect the clients

Diff Detail

rS syncroton
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

mollekopf requested review of this revision.Nov 18 2020, 11:07 PM
mollekopf created this revision.
machniak requested changes to this revision.Nov 19 2020, 8:18 AM
machniak added a subscriber: machniak.
machniak added inline comments.

Maybe this method should be moved to kolab_sync_timezone_converter.


Undefined variable $timezone. Also, please see kolab_sync_data::__construct() regarding $this->timezone. This is a user timezone (if set in Roundcube) or server timezone. We should prefer this timezone over any other matching the offset.

This revision now requires changes to proceed.Nov 19 2020, 8:18 AM
mollekopf updated this revision to Diff 5140.Nov 19 2020, 9:22 AM

Moved the timezone guessing to kolab_sync_timezone_converter and take kolab_format::timezone into account.

Also now including the same logic for the start date.

mollekopf marked 2 inline comments as done.Nov 19 2020, 9:36 AM
machniak accepted this revision.Nov 19 2020, 12:49 PM
This revision is now accepted and ready to land.Nov 19 2020, 12:49 PM
machniak added inline comments.Nov 19 2020, 12:51 PM

Hmmm.. One more thing. Using 'now' everywhere is probably wrong. You're interested in an offset on the specified task start/due date not now. Right?

mollekopf updated this revision to Diff 5152.Nov 19 2020, 5:05 PM

Take the timezone offset at the start date, not at the current date.

This revision was automatically updated to reflect the committed changes.