View Issue Details

IDProjectCategoryView StatusLast Update
0000180SOGoBackend Calendarpublic2009-10-20 20:03
Reporterkutis Assigned Toludovic  
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
Product Version1.0.4 
Target Version1.1.0Fixed in Version1.1.0 
Summary0000180: Adding event in Lightning shifted one hour in web interface
Description

The timezone is set to Europe/Budapest in all components (CentOS, Lightning, .GNUstepDefaults, SOGo web).
All events added in Lightning appear one hour later in the SOGo Web interface. This isn't true for the opposite direction, events created using the web GUI are located correctly in Lightning.

Additional Information

I tried using some other timezone with the same result.
The web inteface gets the event-data from the profilename_quick table. The c_startdate field stores the absolute time (UTC?) as I can see.
Adding the same event (17. oct, 10.00 AM) gives different values:

from Lightning: 1255770000
from Web GUI: 1255766400

The difference is 3600s=1 hour. I think there is an issue converting the Lightning time (DTSTART;TZID=Europe/Budapest:20091017T100000) to the absolute time.

TagsNo tags attached.

Relationships

has duplicate 0000183 resolvedludovic Inconsistency between web interface and lightning 

Activities

ludovic

ludovic

2009-10-17 13:10

administrator   ~0000191

Please provide us:

1- complete ics event inserted from Lightning with c_startdate / c_enddate values from the quick table

2- complete ics event inserted from SOGo Web with c_startdate / c_enddate values from the quick table

Both event should have the same start/end date for ease of debugging.

2009-10-17 19:37

 

cal (1,830 bytes)   
# event created in WebGUI SOGo, started in 12:00 CEST
# diplayed on 12:00 in WebGUI,
# but in 11:00 in Lightning - I see 11:00 /inverse.ca/20091015_1/Europe/Prague there

BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//Inverse inc./SOGo 1.0//EN
BEGIN:VEVENT
UID:4116-4AD99200-1-214F1940
SUMMARY:12-web
CREATED:20091017T094515Z
DTSTAMP:20091017T094515Z
LAST-MODIFIED:20091017T094528Z
DTSTART;TZID=/inverse.ca/20091015_1/Europe/Prague:20091018T110000
DTEND;TZID=/inverse.ca/20091015_1/Europe/Prague:20091018T120000
TRANSP:OPAQUE
END:VEVENT
BEGIN:VTIMEZONE
TZID:/inverse.ca/20091015_1/Europe/Prague
X-LIC-LOCATION:Europe/Prague
BEGIN:DAYLIGHT
TZOFFSETFROM:+0100
TZOFFSETTO:+0200
TZNAME:CEST
DTSTART:19700329T020000
RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU
END:DAYLIGHT
BEGIN:STANDARD
TZOFFSETFROM:+0200
TZOFFSETTO:+0100
TZNAME:CET
DTSTART:19701025T030000
RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU
END:STANDARD
END:VTIMEZONE
END:VCALENDAR";



##

# event created in Lightning, started in 12:00 CEST
# diplayed on 12:00 in Lightning - I see 12:00 Europe/Prague there
# but in 13:00 in SOGo WebGUI

BEGIN:VCALENDAR
PRODID:-//Mozilla.org/NONSGML Mozilla Calendar V1.1//EN
VERSION:2.0
BEGIN:VTIMEZONE
TZID:Europe/Prague
X-LIC-LOCATION:Europe/Prague
BEGIN:DAYLIGHT
TZOFFSETFROM:+0100
TZOFFSETTO:+0200
TZNAME:CEST
DTSTART:19700329T020000
RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=-1SU;BYMONTH=3
END:DAYLIGHT
BEGIN:STANDARD
TZOFFSETFROM:+0200
TZOFFSETTO:+0100
TZNAME:CET
DTSTART:19701025T030000
RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=-1SU;BYMONTH=10
END:STANDARD
END:VTIMEZONE
BEGIN:VEVENT
CREATED:20091017T233149Z
LAST-MODIFIED:20091017T233211Z
DTSTAMP:20091017T233211Z
UID:eb965daa-3872-4b4d-8bce-902404e09b75
SUMMARY:12-lightning
DTSTART;TZID=Europe/Prague:20091018T120000
DTEND;TZID=Europe/Prague:20091018T130000
X-MOZ-GENERATION:1
END:VEVENT
END:VCALENDAR



cal (1,830 bytes)   
wimmer

wimmer

2009-10-17 19:38

reporter   ~0000200

Last edited: 2009-10-17 20:03

Ludovic,

I uploaded files for your request.
File "cal" included event which I created on Oct-17 (when we are in DST)
and it started on Oct-18 (when we are in DST)

File "cal-nov" included event which I created on Oct-18 (when we are in DST)
and it started on Nov-22 (when we will not be in DST)

Milos

2009-10-17 19:58

 

cal-nov (1,821 bytes)   
# this event was created on Oct-18 (when we are in DST) and 
# it started on Nov-22 (when we will not be in DST)

# event created in WebGUI SOGo,
# displayed in 12:00 in WebGUI,
# displayed in 12:00 in Lightning

BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//Inverse inc./SOGo 1.0//EN
BEGIN:VEVENT
UID:412C-4ADA5680-1-D4485940
SUMMARY:12-web-nov
CREATED:20091017T234244Z
DTSTAMP:20091017T234244Z
LAST-MODIFIED:20091017T234244Z
DTSTART;TZID=/inverse.ca/20091015_1/Europe/Prague:20091122T120000
DTEND;TZID=/inverse.ca/20091015_1/Europe/Prague:20091122T130000
TRANSP:OPAQUE
END:VEVENT
BEGIN:VTIMEZONE
TZID:/inverse.ca/20091015_1/Europe/Prague
X-LIC-LOCATION:Europe/Prague
BEGIN:DAYLIGHT
TZOFFSETFROM:+0100
TZOFFSETTO:+0200
TZNAME:CEST
DTSTART:19700329T020000
RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU
END:DAYLIGHT
BEGIN:STANDARD
TZOFFSETFROM:+0200
TZOFFSETTO:+0100
TZNAME:CET
DTSTART:19701025T030000
RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU
END:STANDARD
END:VTIMEZONE
END:VCALENDAR";



# event created in Lightning
# displayed in 12:00 in Lightning,
# displayed in 12:00 in WebGUI

BEGIN:VCALENDAR
PRODID:-//Mozilla.org/NONSGML Mozilla Calendar V1.1//EN
VERSION:2.0
BEGIN:VTIMEZONE
TZID:Europe/Prague
X-LIC-LOCATION:Europe/Prague
BEGIN:DAYLIGHT
TZOFFSETFROM:+0100
TZOFFSETTO:+0200
TZNAME:CEST
DTSTART:19700329T020000
RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=-1SU;BYMONTH=3
END:DAYLIGHT
BEGIN:STANDARD
TZOFFSETFROM:+0200
TZOFFSETTO:+0100
TZNAME:CET
DTSTART:19701025T030000
RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=-1SU;BYMONTH=10
END:STANDARD
END:VTIMEZONE
BEGIN:VEVENT
CREATED:20091017T234257Z
LAST-MODIFIED:20091017T234315Z
DTSTAMP:20091017T234315Z
UID:5da9b8b0-9caa-457a-ba13-6dc79b1f7899
SUMMARY:12-lightning-nov
DTSTART;TZID=Europe/Prague:20091122T120000
DTEND;TZID=Europe/Prague:20091122T130000
X-MOZ-GENERATION:1
END:VEVENT
END:VCALENDAR



cal-nov (1,821 bytes)   
ludovic

ludovic

2009-10-17 20:24

administrator   ~0000201

I not only need that but also the c_startdate/c_enddate values from the quick table for both event. I also need a sample as explained in my first comment.

ludovic

ludovic

2009-10-17 21:23

administrator   ~0000202

I had a quick look at this and my guess is that there might be a bug in the RRULE parser in SOPE.

For example, for America/Montreal, it works and we have:

BEGIN:DAYLIGHT
...
RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=2SU
...
BEGIN:STANDARD
RRULE:FREQ=YEARLY;BYMONTH=11;BYDAY=1SU

while for Europe/Prague, it's broken and we have:

BEGIN:DAYLIGHT
...
RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=3;BYDAY=-1SU\r
..
BEGIN:STANDARD\r
...
RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=10;BYDAY=-1SU\r

The negative BYDAY rule is likely the source of the problem.

wimmer

wimmer

2009-10-18 07:21

reporter   ~0000204

Here are requested values for my "cal" and "cal-nov" uploaded files:

Event c_startdate c_enddate

12-web 1255860000 1255863600
12-lightning 1255863600 1255867200

12-web-nov 1258887600 1258891200
12-lightning-nov 1258887600 1258891200

2009-10-18 17:27

 

Event_17_oct.txt (4,174 bytes)   
Event:
Start date: 17. oct. 10.00 AM
Timezone: Europe/Budapest


ICS created by Lightning:

select * from sogokutisand001057468f7;
                  c_name                  |    c_content    | c_creationdate | c_lastmodified | c_version | c_deleted 
------------------------------------------+-----------------+----------------+----------------+-----------+-----------
 e2b42962-8953-421c-951f-6061e3d71ee8.ics | BEGIN:VCALENDAR
PRODID:-//Mozilla.org/NONSGML Mozilla Calendar V1.1//EN
VERSION:2.0
BEGIN:VTIMEZONE
TZID:Europe/Budapest
X-LIC-LOCATION:Europe/Budapest
BEGIN:DAYLIGHT
TZOFFSETFROM:+0100
TZOFFSETTO:+0200
TZNAME:CEST
DTSTART:19700329T020000
RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=-1SU;BYMONTH=3
END:DAYLIGHT
BEGIN:STANDARD
TZOFFSETFROM:+0200
TZOFFSETTO:+0100
TZNAME:CET
DTSTART:19701025T030000
RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=-1SU;BYMONTH=10
END:STANDARD
END:VTIMEZONE
BEGIN:VEVENT
CREATED:20091018T211203Z
LAST-MODIFIED:20091018T211220Z
DTSTAMP:20091018T211220Z
UID:e2b42962-8953-421c-951f-6061e3d71ee8
SUMMARY:Event from Lightning
DTSTART;TZID=Europe/Budapest:20091017T100000
DTEND;TZID=Europe/Budapest:20091017T110000
X-MOZ-GENERATION:2
END:VEVENT
END:VCALENDAR
 |     1255900320 |     1255900336 |         1 | 


_quick record created by Lightning:


select * from sogokutisand001057468f7_quick;
                  c_name                  |                c_uid                 | c_startdate | c_enddate  | c_cycleenddate |       c_title        | c_participants | c_isallday | c_iscycle | c_cycleinfo | c_classification | c_isopaque | c_status | c_priority | c_location | c_orgmail | c_partmails | c_partstates | c_sequence | c_component | c_nextalarm 
------------------------------------------+--------------------------------------+-------------+------------+----------------+----------------------+----------------+------------+-----------+-------------+------------------+------------+----------+------------+------------+-----------+-------------+--------------+------------+-------------+-------------
 e2b42962-8953-421c-951f-6061e3d71ee8.ics | e2b42962-8953-421c-951f-6061e3d71ee8 |  1255770000 | 1255773600 |                | Event from Lightning |                |          0 |         0 |             |                0 |          1 |        1 |          0 |            |           |             |              |          0 | vevent      |           0


ICS created by SOGo web:

 select * from sogokutisand001057468f7;
          c_name           |    c_content    | c_creationdate | c_lastmodified | c_version | c_deleted 
---------------------------+-----------------+----------------+----------------+-----------+-----------
 CEF-4ADB8680-7-7C8040.ics | BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//Inverse inc./SOGo 1.0//EN
BEGIN:VEVENT
UID:CEF-4ADB8680-7-7C8040
SUMMARY:Event from SOGo web
CREATED:20091018T211954Z
DTSTAMP:20091018T211954Z
LAST-MODIFIED:20091018T211954Z
DTSTART:20091017T080000Z
DTEND:20091017T090000Z
TRANSP:OPAQUE
END:VEVENT
END:VCALENDAR |     1255900794 |     1255900794 |         0 |   

_quick record created by SOGo web:

select * from sogokutisand001057468f7_quick;
          c_name           |         c_uid         | c_startdate | c_enddate  | c_cycleenddate |       c_title       | c_participants | c_isallday | c_iscycle | c_cycleinfo | c_classification | c_isopaque | c_status | c_priority | c_location | c_orgmail | c_partmails | c_partstates | c_sequence | c_component | c_nextalarm 
---------------------------+-----------------------+-------------+------------+----------------+---------------------+----------------+------------+-----------+-------------+------------------+------------+----------+------------+------------+-----------+-------------+--------------+------------+-------------+-------------
 CEF-4ADB8680-7-7C8040.ics | CEF-4ADB8680-7-7C8040 |  1255766400 | 1255770000 |                | Event from SOGo web |                |          0 |         0 |             |                0 |          1 |        1 |          0 |            |           |             |              |          0 | vevent      |           0



Event_17_oct.txt (4,174 bytes)   
kutis

kutis

2009-10-18 17:48

reporter   ~0000207

Ludovic,

I attached the requested data (Event_17_oct.txt).

Sandor

ludovic

ludovic

2009-10-19 12:27

administrator   ~0000215

Try this patch:

--- SOPE/NGCards/iCalTimeZonePeriod.m 3d5a26016cde881cc168146ef554ba0c53654e5d
+++ SOPE/NGCards/iCalTimeZonePeriod.m f6a41bb7f7ddaec9493d613466126a3dc8d734dd
@@ -121,7 +121,10 @@
second: -[self _secondsOfOffset: @"tzoffsetfrom"]];
dateDayOfWeek = [tmpDate dayOfWeek];
// #warning FIXME

  • offset = (dayOfWeek - dateDayOfWeek) + ((pos -1 ) * 7);
  • if (pos < 0)
  • pos++;
  • offset = (dayOfWeek - dateDayOfWeek) + ((pos -1 ) * 7);
    tmpDate = [tmpDate addYear: 0 month: 0 day: offset
    hour: 0 minute: 0 second: 0];
ludovic

ludovic

2009-10-19 20:13

administrator   ~0000219

Reminder sent to: kutis

Can you reproduce the issue with the patch, kutis?

2009-10-20 11:56

 

dst1.diff (1,831 bytes)   
#
# old_revision [a7388b1eb7856d57df84b1de0be0ed020317178c]
#
# patch "SOPE/NGCards/iCalDateTime.h"
#  from [689fc54ca10227b4bc8ffacee0d893879d6ea8e8]
#    to [69fbe2f5f2e1bca0cee5676a41dea904b4d5c7f1]
# 
# patch "SOPE/NGCards/iCalTimeZonePeriod.m"
#  from [3d5a26016cde881cc168146ef554ba0c53654e5d]
#    to [f4735ea479184015397ffbdcb12f4305ed741414]
#
============================================================
--- SOPE/NGCards/iCalDateTime.h	689fc54ca10227b4bc8ffacee0d893879d6ea8e8
+++ SOPE/NGCards/iCalDateTime.h	69fbe2f5f2e1bca0cee5676a41dea904b4d5c7f1
@@ -1,6 +1,6 @@
 /* iCalDateTime.h - this file is part of SOGo
  *
- * Copyright (C) 2006 Inverse inc.
+ * Copyright (C) 2006-2009 Inverse inc.
  *
  * Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
  *
============================================================
--- SOPE/NGCards/iCalTimeZonePeriod.m	3d5a26016cde881cc168146ef554ba0c53654e5d
+++ SOPE/NGCards/iCalTimeZonePeriod.m	f4735ea479184015397ffbdcb12f4305ed741414
@@ -110,6 +110,7 @@
   dayOfWeek = [self dayOfWeekFromRruleDay: [rrule byDayMask]];
   pos = [[byDay substringToIndex: 2] intValue];
   if (!pos)
+    /* if byday = "SU", instead of "1SU"... */
     pos = 1;
 
   tmpDate = [NSCalendarDate dateWithYear: [refDate yearOfCommonEra]
@@ -119,9 +120,17 @@
   tmpDate = [tmpDate addYear: 0 month: ((pos > 0) ? 0 : 1)
 		     day: 0 hour: 0 minute: 0
 		     second: -[self _secondsOfOffset: @"tzoffsetfrom"]];
+
   dateDayOfWeek = [tmpDate dayOfWeek];
-// #warning FIXME
-  offset = (dayOfWeek - dateDayOfWeek) + ((pos -1 ) * 7);
+
+//   if (pos < 0)
+//     pos++;
+
+  if (pos > 0)
+    offset = (dayOfWeek - dateDayOfWeek) + ((pos - 1) * 7);
+  else
+    offset = (dateDayOfWeek - dayOfWeek) + (pos * 7);
+
   tmpDate = [tmpDate addYear: 0 month: 0 day: offset
 		     hour: 0 minute: 0 second: 0];
 
dst1.diff (1,831 bytes)   
ludovic

ludovic

2009-10-20 11:56

administrator   ~0000226

Try the patch I've just added.

ludovic

ludovic

2009-10-20 15:50

administrator   ~0000228

Fixed by http://mtn.inverse.ca/revision/diff/a7388b1eb7856d57df84b1de0be0ed020317178c/with/1cdbd08ce823952005537aad8577c0f54c23c532

kutis

kutis

2009-10-20 19:18

reporter   ~0000231

Ludovic,

is this patch applied to the nightly repo? (I installed it now, but the issue didn't get resolved.)

ludovic

ludovic

2009-10-20 20:03

administrator   ~0000232

Of course not. I applied the fix at 4h00pm and the nightlies are build.. the night after.

Please don't reopen the bug if you're unsure of things.

Issue History

Date Modified Username Field Change
2009-10-17 11:49 kutis New Issue
2009-10-17 13:10 ludovic Note Added: 0000191
2009-10-17 13:11 ludovic Target Version => 1.1.0
2009-10-17 19:37 wimmer File Added: cal
2009-10-17 19:38 wimmer Note Added: 0000200
2009-10-17 19:39 wimmer Note Edited: 0000200
2009-10-17 19:41 wimmer Note Edited: 0000200
2009-10-17 19:58 wimmer File Added: cal-nov
2009-10-17 20:03 wimmer Note Edited: 0000200
2009-10-17 20:24 ludovic Note Added: 0000201
2009-10-17 21:23 ludovic Note Added: 0000202
2009-10-18 07:21 wimmer Note Added: 0000204
2009-10-18 17:27 kutis File Added: Event_17_oct.txt
2009-10-18 17:48 kutis Note Added: 0000207
2009-10-19 12:27 ludovic Note Added: 0000215
2009-10-19 20:13 ludovic Note Added: 0000219
2009-10-20 11:55 ludovic Relationship added has duplicate 0000183
2009-10-20 11:56 ludovic File Added: dst1.diff
2009-10-20 11:56 ludovic Note Added: 0000226
2009-10-20 15:50 ludovic Note Added: 0000228
2009-10-20 15:50 ludovic Status new => resolved
2009-10-20 15:50 ludovic Fixed in Version => 1.1.0
2009-10-20 15:50 ludovic Resolution open => fixed
2009-10-20 15:50 ludovic Assigned To => ludovic
2009-10-20 19:18 kutis Note Added: 0000231
2009-10-20 19:18 kutis Status resolved => feedback
2009-10-20 19:18 kutis Resolution fixed => reopened
2009-10-20 20:03 ludovic Note Added: 0000232
2009-10-20 20:03 ludovic Status feedback => resolved
2009-10-20 20:03 ludovic Resolution reopened => fixed