Page MenuHomekolab.org

Deduce a timezone for tasks due and start date
ClosedPublic

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

Details

Summary

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
timezone.

Diff Detail

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

Event Timeline

mollekopf requested review of this revision.Wed, Nov 18, 11:07 PM
mollekopf created this revision.
machniak requested changes to this revision.Thu, Nov 19, 8:18 AM
machniak added a subscriber: machniak.
machniak added inline comments.
lib/kolab_sync_data_tasks.php
172

Maybe this method should be moved to kolab_sync_timezone_converter.

176

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.Thu, Nov 19, 8:18 AM
mollekopf updated this revision to Diff 5140.Thu, Nov 19, 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.Thu, Nov 19, 9:36 AM
machniak accepted this revision.Thu, Nov 19, 12:49 PM
This revision is now accepted and ready to land.Thu, Nov 19, 12:49 PM
machniak added inline comments.Thu, Nov 19, 12:51 PM
lib/kolab_sync_timezone_converter.php
107

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.Thu, Nov 19, 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.