Dependency Graph

Dependency Graph
related to related to child of child of duplicate of duplicate of

View Issue Details

IDProjectCategoryView StatusLast Update
0002716SOGoBackend Calendarpublic2016-12-22 20:56
Reportermbi Assigned Toludovic  
PriorityhighSeveritymajorReproducibilityalways
Status resolvedResolutionduplicate 
Platform[Client] AppleOSiOSOS Version7
Product Version2.2.3 
Target Version2.3.7 
Summary0002716: Wrong time/timezone for Calendar Invite when accepted on iPhone, OK when accepted on Thunderbird
Description

User was invited to an event from someone (running Exchange) on the West Coast (PST).

The external organizer set the event time to 8:00am PST.

She accepted the event on her iPhone 5 (running iOS 7.1).

The event was added to her calendar, but shows in both their iPhone and Thunderbird+Integrator as being scheduled for 8:00am EST, when it should show 11:00am EST.

Timezone is set correctly in iPhone, Thunderbird and SOGo, and interestingly the event also displays incorrectly in the SOGo web UI, but it shows as scheduled for 4:00am (different from the iPhone or Thunderbird).

Steps To Reproduce
  1. Have organizer send event invitation from Exchange system (not sure what version yet) based in West Coast/PST timezone to Participant in EST timezone.

  2. Accept invitation on iPhone

  3. Note that the time the event shows scheduled for on the iPhone (and in Thunderbird+Integrator) is the wrong time (shows as the same time as the organizer, but in the participants timezone, which is wrong).

Additional Information

Here is the Event Source for an event that was accepted on her iPhone that displays the incorrect time:

***** Begin Event Source

BEGIN:VCALENDAR
PRODID:-//Mozilla.org/NONSGML Mozilla Calendar V1.1//EN
VERSION:2.0
BEGIN:VEVENT
CREATED:20140411T125552Z
LAST-MODIFIED:20140411T125831Z
DTSTAMP:20140411T125831Z
UID:60EC15A4-2B0B-48B4-8CA1-9BBD2EDA3BF2
SUMMARY:Quantcast Test Invite 0000002
PRIORITY:5
STATUS:CONFIRMED
ATTENDEE;PARTSTAT=NEEDS-ACTION;ROLE=REQ-PARTICIPANT;EMAIL=CMarcus@Media-Bro
kers.com;RSVP=TRUE;CUTYPE=INDIVIDUAL;CN=Charles Marcus:mailto:CMarcus@Medi
a-Brokers.com
ATTENDEE;PARTSTAT=NEEDS-ACTION;ROLE=REQ-PARTICIPANT;EMAIL=MStacy@Media-Brok
ers.com;CUTYPE=INDIVIDUAL;CN=Marina Stacy:mailto:MStacy@Media-Brokers.com
DTSTART:20140411T140000
DTEND:20140411T143000
CLASS:PUBLIC
DESCRIPTION:When: Friday\, April 11\, 2014 2:00 PM-2:30 PM. Pacific Standar
d Time\n\n~~~~~~~~~\n\n
SEQUENCE:0
TRANSP:OPAQUE
X-MICROSOFT-CDO-APPT-SEQUENCE:0
X-MICROSOFT-CDO-BUSYSTATUS:TENTATIVE
X-MICROSOFT-CDO-IMPORTANCE:1
X-MICROSOFT-CDO-INSTTYPE:0
X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY
X-MICROSOFT-CDO-OWNERAPPTID:2112115687
X-MOZ-GENERATION:1
BEGIN:VALARM
ACTION:DISPLAY
TRIGGER;X-WEBSTATUS=triggered;VALUE=DURATION:-PT15M
DESCRIPTION:Default Mozilla Description
END:VALARM
ORGANIZER;CN=Ryan Boursse;EMAIL=rboursse@quantcast.com:mailto:rboursse@quan
tcast.com
END:VEVENT
END:VCALENDAR

**** End Event Source

TagsNo tags attached.

Relationships

duplicate of 0002707 resolvedludovic SOGo Integrator Wrong Time/timezone for accepted event showing in iPhone and Thunderbird, shows correct in SOGo web GUI 
duplicate of 0002865 resolvedludovic SOGo SOGo does not interpret date-time without timezone correctly 

Activities

mbi

mbi

2014-04-15 09:56

reporter   ~0006899

I'm opening a new bug for this, since my initial report/assessment was incorrect, and there is no way to edit the Summary or Description of bugs in this bug system after it has been created (would still really like to know why this is).

Would someone please close bug 0002707 and link it to this one?

mbi

mbi

2014-04-15 10:08

reporter   ~0006901

In the prio bug, Christian noted from the Event Source:

"This event does not contain a timezone at all!!!

Start and End are not in GMT/UTC either (mizzing 'Z'-character at the end):
DTSTART:20140411T140000
DTEND:20140411T143000

SOGo seems to read these as GMT/UTC.
Shouldn't it read them as "local" time, which would be EST here?
(This would still be wrong, but seems to be more logical, at least for me.)

But more important, who stripped the timezone in such a crappy way?"

to shich Ludovic responded:

"SOGo will read them as local time, not UTC.

It would read them as UTC if a Z was ending the date-time."

So, since the Event is correctly handled by Thunderbird+Integrator, the timezone must be there initially, so the bug obviously is in the CalDAV interaction between iPhone/iOS and SOGo backend.

Now the only question is, is the bug in iOS or SOGo? If iOS, is there anything that can be done to work around it in SOGo? If not, do you guys have any relationship(s) with Apple Devs for reporting the problem?

Sergey Urushkin

Sergey Urushkin

2015-11-12 13:56

reporter   ~0009093

Seems http://www.sogo.nu/bugs/view.php?id=2865 is duplicate of this bug. Much info has been given there, please, look at it.

I've attached a patch that partly fixes the issue (using Lightning logic) - after applying, event pop-ups and event-edition dialogs show correct time, excepting that local-time is server local-time, not user local-time (as it should be). To use user's local time something like this could be used:

#import <NGObjWeb/WOContext+SoObjects.h>
#import <SOGo/SOGoUserDefaults.h>
WOContext context;
SOGoUserDefaults
ud;
tz = [NSTimeZone timeZoneWithName: [[[context activeUser] userDefaults] timeZoneName]];

But this gives me errors like:
EXCEPTION: <NSException: 0x7fade982b608> NAME:NSInvalidArgumentException REASON:iCalDateTime(instance) does not recognize activeUser INFO:(null)

Anyway, this is only a partial fix, as day-week-month table view still uses original SOGo logic. Developers, please, tell me, where can I find a place in the code to change the table view?

Sergey Urushkin

Sergey Urushkin

2015-11-12 14:01

reporter  

iCalDateTime.m.patch (1,941 bytes)   
--- iCalDateTime.m.orig	2015-09-16 23:56:55.000000000 +0300
+++ iCalDateTime.m	2015-11-12 16:25:56.414120935 +0300
@@ -87,9 +87,13 @@
   tzId = [self value: 0 ofAttribute: @"tzid"];
   if ([tzId length])
     {
-      calendar
-	= (iCalCalendar *) [self searchParentOfClass: [iCalCalendar class]];
-      timeZone = [calendar timeZoneWithId: tzId];
+      timeZone = [iCalTimeZone timeZoneForName: tzId];
+      if (!timeZone)
+	{
+	  calendar
+	    = (iCalCalendar *) [self searchParentOfClass: [iCalCalendar class]];
+	  timeZone = [calendar timeZoneWithId: tzId];
+        }
       //if (!timeZone)
       //[self logWithFormat: @"timezone '%@' not found in calendar", tzId];
     }
@@ -163,7 +167,7 @@
   NSCalendarDate *initialDate, *dateTime;
   NSArray *subValues;
   NSMutableArray *dates;
-  //NSTimeZone *tz;
+  NSTimeZone *tz;
   unsigned count, i;
 
   subValues = [self valuesAtIndex: 0 forKey: @""];
@@ -172,32 +176,29 @@
   for (i = 0; i < count; i++)
     {
       date = [subValues objectAtIndex: i];
-      iTZ = [self timeZone];
 
-      if (iTZ)
-	dateTime = [iTZ dateForDateTimeString: date];
-      else
+      initialDate = [date asCalendarDate];
+      if (initialDate)
 	{
-	  initialDate = [date asCalendarDate];
-	  if (initialDate)
+	  if ([date hasSuffix: @"Z"] || [date hasSuffix: @"z"])
 	    dateTime = initialDate;
-	  /*
+	  else
 	    {
-	      if ([date hasSuffix: @"Z"] || [date hasSuffix: @"z"])
-		dateTime = initialDate;
+	      iTZ = [self timeZone];
+	      if (iTZ)
+		dateTime = [iTZ dateForDateTimeString: date];
 	      else
 		{
-		  // same TODO as above
 		  tz = [NSTimeZone defaultTimeZone];
 		  dateTime = [initialDate addYear: 0 month: 0 day: 0
 					     hour: 0 minute: 0
 					   second: -[tz secondsFromGMTForDate: initialDate]];
-		}
+		  }
 	    }
-	  */
-	  else
-	    dateTime = nil;
 	}
+      else
+	dateTime = nil;
+
       if (dateTime)
 	[dates addObject: dateTime];
     }
iCalDateTime.m.patch (1,941 bytes)   
ludovic

ludovic

2016-12-22 20:56

administrator   ~0011098

Closing this one for now, we'll track only 2865 as more details are in there.

Issue History

Date Modified Username Field Change
2014-04-15 09:55 mbi New Issue
2014-04-15 09:56 mbi Note Added: 0006899
2014-04-15 10:08 mbi Note Added: 0006901
2014-04-16 10:05 Christian Mack Relationship added duplicate of 0002707
2014-09-12 15:26 ludovic Target Version => 2.2.9
2014-09-26 13:37 ludovic Target Version 2.2.9 => 2.2.10
2014-11-07 20:41 ludovic Target Version 2.2.10 => 2.2.11
2014-12-04 19:30 ludovic Target Version 2.2.11 => 2.2.12
2014-12-18 14:38 ludovic Target Version 2.2.12 => 2.2.13
2014-12-30 15:28 ludovic Target Version 2.2.13 => 2.2.14
2015-01-20 16:23 ludovic Target Version 2.2.14 => 2.2.15
2015-01-30 18:10 ludovic Target Version 2.2.15 => 2.2.16
2015-02-12 16:15 ludovic Target Version 2.2.16 => 2.2.17
2015-03-24 18:25 francis Target Version 2.2.17 => 2.3.0
2015-05-12 19:51 ludovic Target Version 2.3.0 => 2.3.1
2015-07-23 17:44 ludovic Target Version 2.3.1 => 2.3.2
2015-09-16 19:20 ludovic Target Version 2.3.2 => 2.3.3
2015-11-11 14:23 ludovic Target Version 2.3.3 => 2.3.4
2015-11-12 13:56 Sergey Urushkin Note Added: 0009093
2015-11-12 14:01 Sergey Urushkin File Added: iCalDateTime.m.patch
2015-12-16 16:08 ludovic Target Version 2.3.4 => 2.3.5
2016-01-07 14:56 ludovic Target Version 2.3.5 => 2.3.6
2016-01-18 18:20 ludovic Target Version 2.3.6 => 2.3.7
2016-12-22 20:56 ludovic Note Added: 0011098
2016-12-22 20:56 ludovic Relationship added duplicate of 0002865
2016-12-22 20:56 ludovic Status new => resolved
2016-12-22 20:56 ludovic Resolution open => duplicate
2016-12-22 20:56 ludovic Assigned To => ludovic