[#14153] Weekly invitation adds one hour to the start time
Summary Weekly invitation adds one hour to the start time
Queue Horde Framework Packages
Type Bug
State Resolved
Priority 1. Low
Owners Horde Developers, mrubinsk@horde.org
Requester jose.antonio.calvo@upcnet.es
Created 2015-11-04 (1321 days ago)
Due
Updated 2017-10-20 (605 days ago)
Assigned 2015-11-11 (1314 days ago)
Resolved 2015-11-17 (1308 days ago)
Milestone
Patch No

Comments
jose.antonio.calvo@upcnet.es 2015-11-04 14:45:25
When creating a weekly event, the mail with the iTip invitation readed 
in IMP 6.2.11 shows it starts one hour later depending on the start 
date.

All the following are weekly events starting at 15:00 and ending at 16:00.

The mail with the invitation readed with IMP 6.2.11 shows the events 
start at 16:00 (that is, one our later) in these starting dates:

- 4-sept-2015
- 3-oct-2015
- 28-march-2016
- 7-apr-2016

This problem occurs when reading the invitation mail with IMP 6.2.11, 
but if the same mails are readed with Thunderbird 38.3, the starting 
hour is correct.

On the contrary, the mail with the invitation shows the events start 
at 15:00 in these starting dates with both IMP 6.2.11 or Thunderbird 
38.3:

- 4-oct-2015
- 27-march-2016
- 2-oct-2016
- 30-oct-2016

I attach a zip with the following screenshots:

- Weekly invitation created with Kronolith 4.2.11, starting at 
3-oct-2015 15:00-16:00 and ending at 31-oct-2015.

- The iTip mail with the invitation as shown in IMP 6.2.11 starting at 
16:00 (one hour later)

- The same iTip mail with the invitation as shown in Thunderbird 38.3 
starting at 15:00.

Note: this problem was reported previuosly in the ticked 14117, which 
is in "No feedback" state. Initially we thought the problem was 
related to Kronolith, but the latest tests appear to reveal that the 
problem is related to IMP.

Michael Rubinsky <mrubinsk@horde.org> 2015-11-08 17:59:58
I still can't reproduce, and I still need the questions answered that 
I asked in the other ticket. Also, please attach a ical file of an 
event that this happens with.

jose.antonio.calvo@upcnet.es 2015-11-09 07:41:02
> I still can't reproduce, and I still need the questions answered 
> that I asked in the other ticket. Also, please attach a ical file of 
> an event that this happens with.

The questions I see in ticket 14117 were made at 2015-09-22 12:00:40 
and this answer was given in a comment at 2015-10-14 09:03:36:

"The event was created with timezone Europe/Madrid and when the
attendee accepts it, timezone displayed in the entry is the same.

We have repeated the tests with IMP 7.0.0 git master and the problem
happens in dates before 4-oct-2015 (the first sunday in october month)
but are OK after that date. By the way, DST ends the last sunday in
the october month, that is, 25-oct."

I attach a rar file with two ical files inside:

- event-invitation-20151003_KO.ics: the start hour  is OK (15:00) in 
both Thunderbird and IMP.

- event-invitation-20151003_KO.ics: the start hour is not OK (16:00) 
in IMP but is OK (15:00) in Thunderbird.

If you need more info, please, let me know.

Thank you!

Michael Rubinsky <mrubinsk@horde.org> 2015-11-11 19:48:50
Ok. This helps. It's not really related to IMP, or even Kronolith. 
It's something in the ICalendar library during the parsing. I have a 
failng test now, at least, though I have no idea why it's broken.

Michael Rubinsky <mrubinsk@horde.org> 2015-11-11 21:53:11
I've narrowed it down to either a broken VTimezone definition or an 
issue in the way we sort the components in 
Horde_Icalendar::_parseTZID(). There is some strange interaction going 
on  with the transition 'end' values vs the 'time' values in this zone 
when they are being sorted such that the incorrect zone is detected as 
the correct one.

If C is the current component then:

The date we are checking (D) is larger than the C's ['time'] value and 
less than (C+1)'s ['time'] value - but because of  (C+1)'s ['end'] 
value, (C+2) and above's ['time] value is less than D until at some 
point we get the correct component (C+x) where the ['time'] value is 
still less than the date we are checking, but (C+x+1)'s ['time'] value 
is larger that the date we are checking - and both are still less than 
the  (C+2) ['time'] value.

tldr; the sorted components are not correctly sorted by 'time'.  It 
could very well be the timezone definition is broken, but I'm not 100% 
sure how to tell yet.

Git Commit <commits@lists.horde.org> 2015-11-11 22:43:51
Changes have been made in Git (master):

commit 07929cf40eaf7d78bc41371fc96da2d52a85fb64
Author: Michael J Rubinsky <mrubinsk@horde.org>
Date:   Wed Nov 11 17:41:55 2015 -0500

     Bug: 14153 Fix cases where transition times were being returned 
incorrectly.

  framework/Icalendar/lib/Horde/Icalendar.php        |   34 +++-
  framework/Icalendar/package.xml                    |    6 +-
  .../Icalendar/test/Horde/Icalendar/ParseTest.php   |   12 +
  .../test/Horde/Icalendar/fixtures/bug14153.ics     |  263 
++++++++++++++++++++
  4 files changed, 312 insertions(+), 3 deletions(-)

http://github.com/horde/horde/commit/07929cf40eaf7d78bc41371fc96da2d52a85fb64

Michael Rubinsky <mrubinsk@horde.org> 2015-11-11 22:44:50
Does this fix it for you?

Git Commit <commits@lists.horde.org> 2015-11-15 15:05:28
Changes have been made in Git (master):

commit 1dfebf6fdad4391f520bf2265181d432368df3b8
Merge: 8472ef2 805b9b5
Author: Jan Schneider <jan@horde.org>
Date:   Sun Nov 15 16:05:04 2015 +0100

     Merge branch 'master' of ssh://dev.horde.org/horde/git/horde

  .travis.yml                                        |   18 +-
  framework/ActiveSync/composer.json                 |    4 +-
  .../lib/Horde/ActiveSync/Connector/Exporter.php    |    8 +-
  .../ActiveSync/lib/Horde/ActiveSync/Device.php     |  112 ++-
  .../ActiveSync/lib/Horde/ActiveSync/Device/Ios.php |   79 ++
  .../lib/Horde/ActiveSync/Message/Base.php          |    2 +-
  .../lib/Horde/ActiveSync/Message/Contact.php       |   15 +
  .../lib/Horde/ActiveSync/Request/Search.php        |    2 -
  .../lib/Horde/ActiveSync/State/Mongo.php           |    2 +-
  .../ActiveSync/lib/Horde/ActiveSync/State/Sql.php  |   24 +-
  .../lib/Horde/ActiveSync/Wbxml/Decoder.php         |    4 +-
  framework/ActiveSync/package.xml                   |   61 ++-
  .../test/Horde/ActiveSync/ContactTest.php          |   24 +-
  .../test/Horde/ActiveSync/DeviceTest.php           |   51 +-
  framework/Core/composer.json                       |    4 +-
  framework/Core/js/map/horde.js                     |    6 +
  framework/Core/js/map/owm.js                       |   89 ++
  .../Core/lib/Horde/Core/ActiveSync/Connector.php   |    3 +-
  .../Core/lib/Horde/Core/ActiveSync/Driver.php      |   32 +-
  .../lib/Horde/Core/ActiveSync/Logger/Factory.php   |    2 +-
  .../Ajax/Imple/WeatherLocationAutoCompleter.php    |    9 +-
  framework/Core/lib/Horde/Core/Factory/Alarm.php    |    2 +-
  framework/Core/lib/Horde/Core/Factory/Weather.php  |    2 +-
  framework/Core/lib/Horde/Deprecated.php            |    2 +-
  framework/Core/package.xml                         |   43 +-
  .../test/Horde/Exception/ExceptionTest.php         |    4 +-
  framework/Icalendar/lib/Horde/Icalendar.php        |   34 +-
  framework/Icalendar/package.xml                    |   10 +-
  .../Icalendar/test/Horde/Icalendar/ParseTest.php   |   23 +
  .../test/Horde/Icalendar/fixtures/bug14132.ics     |   46 +
  .../test/Horde/Icalendar/fixtures/bug14153.ics     |  263 ++++++
  .../lib/Horde/Kolab/Filter/Transport.php           |    2 +-
  .../lib/Horde/Kolab/Storage/Cache/Data.php         |   38 +-
  framework/Nls/composer.json                        |    4 +-
  framework/Nls/package.xml                          |   21 +-
  framework/Notification/composer.json               |    4 +-
  framework/Notification/package.xml                 |   19 +-
  framework/Pdf/composer.json                        |    4 +-
  framework/Pdf/package.xml                          |   19 +-
  .../phpseclib/phpseclib/phpseclib/Crypt/AES.php    |   20 +-
  .../phpseclib/phpseclib/phpseclib/Crypt/Base.php   |  838 ++++++++++++++----
  .../phpseclib/phpseclib/Crypt/Blowfish.php         |   81 +-
  .../phpseclib/phpseclib/phpseclib/Crypt/DES.php    |   73 +-
  .../phpseclib/phpseclib/phpseclib/Crypt/Hash.php   |   38 +-
  .../phpseclib/phpseclib/phpseclib/Crypt/RC2.php    |  160 +++-
  .../phpseclib/phpseclib/phpseclib/Crypt/RC4.php    |   50 +-
  .../phpseclib/phpseclib/phpseclib/Crypt/RSA.php    |  176 +++-
  .../phpseclib/phpseclib/phpseclib/Crypt/Random.php |    6 +-
  .../phpseclib/phpseclib/Crypt/Rijndael.php         |  861 +++++++-----------
  .../phpseclib/phpseclib/Crypt/TripleDES.php        |   71 ++-
  .../phpseclib/phpseclib/Crypt/Twofish.php          |   31 +-
  .../phpseclib/phpseclib/phpseclib/File/ANSI.php    |  283 ++++---
  .../phpseclib/phpseclib/phpseclib/File/ASN1.php    |   29 +-
  .../phpseclib/phpseclib/phpseclib/File/X509.php    |   90 ++-
  .../phpseclib/phpseclib/Math/BigInteger.php        |  191 ++--
  .../phpseclib/phpseclib/phpseclib/Net/SCP.php      |    8 +-
  .../phpseclib/phpseclib/phpseclib/Net/SFTP.php     |  191 +++-
  .../phpseclib/phpseclib/Net/SFTP/Stream.php        |    7 +-
  .../phpseclib/phpseclib/phpseclib/Net/SSH1.php     |   14 +-
  .../phpseclib/phpseclib/phpseclib/Net/SSH2.php     |  959 
++++++++++++++------
  .../phpseclib/phpseclib/System/SSH/Agent.php       |  147 +++
  framework/Queue/composer.json                      |    4 +-
  framework/Queue/package.xml                        |   19 +-
  framework/Secret/composer.json                     |    4 +-
  framework/Secret/package.xml                       |   19 +-
  framework/Service_Weather/composer.json            |    4 +-
  .../Service_Weather/lib/Horde/Service/Weather.php  |   16 +
  .../lib/Horde/Service/Weather/Base.php             |    8 +-
  .../lib/Horde/Service/Weather/Current/Owm.php      |   94 ++
  .../lib/Horde/Service/Weather/Forecast/Owm.php     |   73 ++
  .../lib/Horde/Service/Weather/Owm.php              |  379 ++++++++
  .../lib/Horde/Service/Weather/Period/Base.php      |    2 +-
  .../lib/Horde/Service/Weather/Period/Owm.php       |   89 ++
  .../Horde/Service/Weather/WeatherUnderground.php   |   12 +-
  .../lib/Horde/Service/Weather/Wwo.php              |    3 +-
  framework/Service_Weather/package.xml              |   33 +-
  .../test/Horde/Service/Weather/Wwov2Test.php       |   11 +-
  framework/SessionHandler/composer.json             |    6 +-
  framework/SessionHandler/package.xml               |   20 +-
  framework/Token/composer.json                      |    4 +-
  framework/Token/package.xml                        |   19 +-
  framework/Vcs/test/Horde/Vcs/CvsTest.php           |    1 +
  framework/Vcs/test/Horde/Vcs/RcsTest.php           |    1 +
  gollem/lib/Gollem.php                              |    1 +
  hermes/js/hermes.js                                |    1 +
  hermes/lib/Ajax/Application/Handler.php            |   11 +-
  hermes/templates/dynamic/deliverables.inc          |    2 +
  hermes/themes/default/dynamic/screen.css           |    6 +-
  horde/admin/cmdshell.php                           |    3 +-
  horde/admin/phpshell.php                           |    2 +
  horde/admin/sqlshell.php                           |    5 +-
  horde/config/conf.xml                              |    5 +-
  horde/docs/CHANGES                                 |    1 +
  horde/js/weatherblockmap.js                        |   33 +
  horde/lib/Block/Weather.php                        |   25 +-
  horde/lib/Test.php                                 |    2 +-
  horde/lib/View/Sidebar.php                         |   20 +-
  horde/package.xml                                  |   12 +-
  horde/templates/admin/cmdshell.html.php            |    2 +
  horde/templates/admin/phpshell.html.php            |    2 +
  horde/templates/admin/sqlshell.html.php            |    2 +
  horde/templates/block/weather.html.php             |  144 +---
  horde/templates/block/weather_content.html.php     |  127 +++
  horde/themes/default/block/screen.css              |   28 +-
  imp/config/hooks.php.dist                          |   20 +
  imp/docs/CHANGES                                   |    1 +
  imp/lib/Ajax/Application/Handler/Dynamic.php       |    2 +-
  imp/lib/Auth.php                                   |    9 +
  imp/lib/Compose.php                                |   12 +-
  imp/lib/Mime/Viewer/Html.php                       |    2 +-
  imp/lib/Prefs/Special/PgpPrivateKey.php            |    1 +
  imp/lib/Smime.php                                  |    2 +-
  imp/package.xml                                    |    1 +
  imp/templates/prefs/pgpprivatekey.html.php         |    2 +
  ingo/lib/Basic/Forward.php                         |    8 +-
  ingo/lib/Basic/Spam.php                            |    8 +-
  ingo/lib/Basic/Vacation.php                        |    8 +-
  kronolith/lib/Ajax/Application/Handler.php         |   91 ++-
  kronolith/lib/Api.php                              |   13 +-
  kronolith/lib/Application.php                      |    8 +-
  kronolith/lib/Event.php                            |   20 +-
  kronolith/lib/Kronolith.php                        |   19 +-
  nag/app/controllers/SaveTask.php                   |    3 -
  nag/lib/Api.php                                    |    4 +-
  nag/lib/Driver.php                                 |    5 +
  nag/lib/Search.php                                 |   27 +-
  nag/lib/TagBrowser.php                             |    9 +-
  nag/lib/Task.php                                   |   49 +-
  nag/task.php                                       |    2 -
  trean/data.php                                     |   17 +-
  trean/docs/CHANGES                                 |    1 +
  trean/lib/Data/Html.php                            |   86 ++
  trean/package.xml                                  |    5 +-
  turba/lib/Api.php                                  |   27 +-
  turba/lib/Driver.php                               |    4 +
  turba/lib/Driver/Kolab.php                         |    2 +-
  turba/lib/Driver/Sql.php                           |    4 +-
  turba/lib/Driver/Vbook.php                         |   13 +-
  turba/lib/Turba.php                                |    1 +
  whups/lib/Api.php                                  |    6 +-
  whups/lib/Driver.php                               |   24 +-
  whups/lib/Driver/Sql.php                           |   48 +-
  142 files changed, 5304 insertions(+), 1930 deletions(-)

http://github.com/horde/horde/commit/1dfebf6fdad4391f520bf2265181d432368df3b8

jose.antonio.calvo@upcnet.es 2015-11-16 11:32:43
> Does this fix it for you?

Yes, we have replaced the file Icalendar.php in our test environment 
then the problem is solved, thanks!!!

We would like to apply this solution to a production environment 
running Horde Groupware Webmail Edition 5.2.11 with stable release 
modules as following:

Horde 5.2.8
Imp 6.2.11
Kronolith 4.2.11
Ingo 3.2.7
Gollem 3.0.6
Turba 4.2.11
Trean 1.1.3
Mnemo 4.2.8
Nag 4.2.6

How we have to do for applying the provided solution in this 
environment? Do we have to wait until some new production version of 
any of these modules will be released?

Michael Rubinsky <mrubinsk@horde.org> 2015-11-16 12:52:44
Yes. It will be the Horde_Icalendar library, and now that I have 
received your feedback I can prepare a new release. It should be out 
later today.

Michael Rubinsky <mrubinsk@horde.org> 2015-11-17 17:13:58
Released.

Git Commit <commits@lists.horde.org> 2017-02-07 18:09:40
Changes have been made in Git (master):

commit d1a00a65f21deb6e56851ddfb69c250a3370de10
Author: Michael J Rubinsky <mrubinsk@horde.org>
Date:   Tue Feb 7 13:08:53 2017 -0500

     Add new tests.

     Still have one test locally that is failing that I need to track down.

  .../test/Horde/Icalendar/fixtures/bug14153_2.ics   |  57 ++++++
  .../Horde/Icalendar/fixtures/vTimezone/Chicago.ics | 191 
+++++++++++++++++++++
  .../Horde/Icalendar/fixtures/vTimezone/Chicago.txt |   2 +
  3 files changed, 250 insertions(+)

http://github.com/horde/horde/commit/d1a00a65f21deb6e56851ddfb69c250a3370de10

Git Commit <commits@lists.horde.org> 2017-10-20 21:10:58
Changes have been made in Git (master):

commit 11b004573ec1853430641985153167a1c96c5607
Author: Jan Schneider <jan@horde.org>
Date:   Fri, 20 Oct 2017 17:18:18 +0200

Fix file mode.

  M doc/Horde/Icalendar/examples/parser.php
  M test/Horde/Icalendar/fixtures/bug14153_2.ics
  M test/Horde/Icalendar/fixtures/vTimezone/Chicago2.ics

https://github.com/horde/Icalendar/commit/11b004573ec1853430641985153167a1c96c5607