View Issue Details

IDProjectCategoryView StatusLast Update
0002736SOGoWeb Calendarpublic2014-06-16 15:33
Reporterbuzzdee Assigned Toludovic  
PriorityhighSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
Platformamd64OSOpenBSDOS Version4.5
Product Version2.2.4 
Target Version2.2.6Fixed in Version2.2.6 
Summary0002736: entering appointments creates "empty" appointment on January 1st 1970
Description

I created an appointment via the webinterface, put in title location etc.
However, after save and close, it was on January 1st. 1970, without my other added information, i.e. title, location, description etc.
The time was also wrong.

Afterward I tried to edit the appointment, but it doesn't change update it.

TagsNo tags attached.

Activities

buzzdee

buzzdee

2014-05-09 09:48

reporter  

appointment_content_in_database.txt (3,016 bytes)   
sogo=> select * from sogosebastia0012d5c0c3f where c_name='1CC7-536CDB80-9-6B8B4580.ics';
            c_name            |                c_content                | c_creationdate | c_lastmodified | c_version | c_deleted
------------------------------+-----------------------------------------+----------------+----------------+-----------+-----------
 1CC7-536CDB80-9-6B8B4580.ics | BEGIN:VCALENDAR\r                      +|     1399642982 |     1399642982 |         0 |
                              | PRODID:-//Inverse inc./SOGo 2.2.3//EN\r+|                |                |           |
                              | VERSION:2.0\r                          +|                |                |           |
                              | BEGIN:VTIMEZONE\r                      +|                |                |           |
                              | BEGIN:DAYLIGHT\r                       +|                |                |           |
                              | END:DAYLIGHT\r                         +|                |                |           |
                              | BEGIN:STANDARD\r                       +|                |                |           |
                              | END:STANDARD\r                         +|                |                |           |
                              | END:VTIMEZONE\r                        +|                |                |           |
                              | BEGIN:VEVENT\r                         +|                |                |           |
                              | UID:1CC7-536CDB80-9-6B8B4580\r         +|                |                |           |
                              | SUMMARY:TESTEVENT\r                    +|                |                |           |
                              | LOCATION:TESTLOCATION\r                +|                |                |           |
                              | CLASS:PUBLIC\r                         +|                |                |           |
                              | CREATED:20140509T134300Z\r             +|                |                |           |
                              | DTSTAMP:20140509T134300Z\r             +|                |                |           |
                              | LAST-MODIFIED:20140509T134300Z\r       +|                |                |           |
                              | DTSTART;:20140509T134500Z\r            +|                |                |           |
                              | DTEND;:20140509T144500Z\r              +|                |                |           |
                              | TRANSP:OPAQUE\r                        +|                |                |           |
                              | END:VEVENT\r                           +|                |                |           |
                              | END:VCALENDAR                           |                |                |           |
buzzdee

buzzdee

2014-05-09 09:48

reporter   ~0007009

The appointment information stored in the database seems to be OK, see attached file containing psql output.

buzzdee

buzzdee

2014-06-10 07:16

reporter   ~0007168

I went through the hassle, and checked each version beginning with 2.2.0. Version 2.2.3 is the last one that works, version 2.2.4 shows the problem.

With 2.2.4 and onward, the events saved in the database look odd, compared to the one saved with 2.2.3 or earlier. See attached file EVENTS.txt

buzzdee

buzzdee

2014-06-10 07:17

reporter  

EVENTS.txt (8,863 bytes)   
 6568-5396D700-1-6B8B4580.ics  | BEGIN:VCALENDAR\r                                                                  +|     1402394378 |     1402394378 |         0 |          
                               | PRODID:-//Inverse inc./SOGo 2.2.3//EN\r                                            +|                |                |           | 
                               | VERSION:2.0\r                                                                      +|                |                |           | 
                               | BEGIN:VTIMEZONE\r                                                                  +|                |                |           | 
                               | TZID:Europe/Berlin\r                                                               +|                |                |           | 
                               | X-LIC-LOCATION:Europe/Berlin\r                                                     +|                |                |           | 
                               | BEGIN:DAYLIGHT\r                                                                   +|                |                |           | 
                               | TZOFFSETFROM:+0100\r                                                               +|                |                |           | 
                               | TZOFFSETTO:+0200\r                                                                 +|                |                |           | 
                               | TZNAME:CEST\r                                                                      +|                |                |           | 
                               | DTSTART:19700329T020000\r                                                          +|                |                |           | 
                               | RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU\r                                           +|                |                |           | 
                               | END:DAYLIGHT\r                                                                     +|                |                |           | 
                               | BEGIN:STANDARD\r                                                                   +|                |                |           | 
                               | TZOFFSETFROM:+0200\r                                                               +|                |                |           | 
                               | TZOFFSETTO:+0100\r                                                                 +|                |                |           | 
                               | TZNAME:CET\r                                                                       +|                |                |           | 
                               | DTSTART:19701025T030000\r                                                          +|                |                |           | 
                               | RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU\r                                          +|                |                |           | 
                               | END:STANDARD\r                                                                     +|                |                |           | 
                               | END:VTIMEZONE\r                                                                    +|                |                |           | 
                               | BEGIN:VEVENT\r                                                                     +|                |                |           | 
                               | UID:6568-5396D700-1-6B8B4580\r                                                     +|                |                |           | 
                               | SUMMARY:TestEvent223\r                                                             +|                |                |           | 
                               | CLASS:PUBLIC\r                                                                     +|                |                |           | 
                               | CREATED:20140610T095938Z\r                                                         +|                |                |           | 
                               | DTSTAMP:20140610T095938Z\r                                                         +|                |                |           | 
                               | LAST-MODIFIED:20140610T095938Z\r                                                   +|                |                |           | 
                               | DTSTART;TZID=Europe/Berlin:20140610T150000\r                                       +|                |                |           | 
                               | DTEND;TZID=Europe/Berlin:20140610T161500\r                                         +|                |                |           | 
                               | TRANSP:OPAQUE\r                                                                    +|                |                |           | 
                               | END:VEVENT\r                                                                       +|                |                |           | 
                               | END:VCALENDAR                                                                       |                |                |           | 
 7B03-5396E780-1-6B8B4580.ics  | BEGIN:VCALENDAR\r                                                                  +|     1402398647 |     1402398647 |         0 |          
                               | PRODID:-//Inverse inc./SOGo 2.2.4//EN\r                                            +|                |                |           | 
                               | VERSION:2.0\r                                                                      +|                |                |           | 
                               | BEGIN:VTIMEZONE\r                                                                  +|                |                |           | 
                               | BEGIN:DAYLIGHT\r                                                                   +|                |                |           | 
                               | END:DAYLIGHT\r                                                                     +|                |                |           | 
                               | BEGIN:STANDARD\r                                                                   +|                |                |           | 
                               | END:STANDARD\r                                                                     +|                |                |           | 
                               | END:VTIMEZONE\r                                                                    +|                |                |           | 
                               | BEGIN:VEVENT\r                                                                     +|                |                |           | 
                               | UID:7B03-5396E780-1-6B8B4580\r                                                     +|                |                |           | 
                               | SUMMARY:TestEvent224\r                                                             +|                |                |           | 
                               | CLASS:PUBLIC\r                                                                     +|                |                |           | 
                               | CREATED:20140610T111047Z\r                                                         +|                |                |           | 
                               | DTSTAMP:20140610T111047Z\r                                                         +|                |                |           | 
                               | LAST-MODIFIED:20140610T111047Z\r                                                   +|                |                |           | 
                               | DTSTART;:20140610T144500Z\r                                                        +|                |                |           | 
                               | DTEND;:20140610T154500Z\r                                                          +|                |                |           | 
                               | TRANSP:OPAQUE\r                                                                    +|                |                |           | 
                               | END:VEVENT\r                                                                       +|                |                |           | 
                               | END:VCALENDAR
EVENTS.txt (8,863 bytes)   
buzzdee

buzzdee

2014-06-10 07:18

reporter   ~0007169

The initial product version I specified doesn't seem to be correct, but it seems I cannot change it to 2.2.4

buzzdee

buzzdee

2014-06-10 07:18

reporter   ~0007170

Tests are done on 64Bit system, tests on 32Bit will follow.

buzzdee

buzzdee

2014-06-11 05:59

reporter   ~0007178

On i386, trying to access the same calendar, sogo unfortunately dies with:

Jun 11 11:56:57 sogod [2533]: [ERROR] |assoc=currentDay.dayOfMonth| unsupported type 'l' !
EXCEPTION: <NSException: 0x7ab7e728> NAME:WORuntimeException REASON:in WOKeyPathAssociation <WOKeyPathAssociation[0x0x795a1b68]: keyPath=currentDay.dayOfMonth>: unsupported type 'l' INFO:(null)

with version 2.2.4, going to try 2.2.5 on that machine.

buzzdee

buzzdee

2014-06-12 14:43

reporter   ~0007206

after fixing bug 0002814, I found, the problem also appears on 32Bit i386.

buzzdee

buzzdee

2014-06-15 02:33

reporter   ~0007209

More analysis and tracking down the root cause has shown that he fix to the minor problem I reported with bug 2789 broke it.

The fix was right, but the solution was not complete :(

attached patches fixes all occurences of the changed methods from int -> NSUInteger.
Basically, the patches are more or less just only int -> NSUInteger chagnges.

Please add them to the 2.2.6 release.

buzzdee

buzzdee

2014-06-15 02:34

reporter  

sogo-fix-for-bug-2736.diff (2,892 bytes)   
$OpenBSD$

fix from bug 2736

--- SOPE/NGCards/NGCardsSaxHandler.m.orig	Sat Jun 14 21:21:16 2014
+++ SOPE/NGCards/NGCardsSaxHandler.m	Sat Jun 14 21:22:00 2014
@@ -232,7 +232,7 @@ static NSArray *privilegedTagNames = nil;
 }
 
 - (void) characters: (unichar *) _chars
-             length: (int) _len
+             length: (NSUInteger) _len
 {
   if (_len && _chars)
     {
$OpenBSD$

fix from bug 2736

--- SOPE/NGCards/samples/vcf2xml.m.orig	Sat Jun 14 20:48:30 2014
+++ SOPE/NGCards/samples/vcf2xml.m	Sat Jun 14 20:49:23 2014
@@ -217,10 +217,10 @@
   printf("</%s>\n", [_localName cString]);
 }
 
-- (void)characters:(unichar *)_chars length:(int)_len {
+- (void)characters:(unichar *)_chars length:(NSUInteger)_len {
   NSString *str;
   id tmp;
-  unsigned i, len;
+  NSUInteger i, len;
 
   if (_len == 0) {
     [self indent];
@@ -228,7 +228,7 @@
     return;
   }
   
-  for (i = 0; i < (unsigned)_len; i++) {
+  for (i = 0; i < _len; i++) {
     if (_chars[i] > 255) {
       NSLog(@"detected large char: o%04o d%03i h%04X",
             _chars[i], _chars[i], _chars[i]);
@@ -246,7 +246,7 @@
   [self indent];
   printf("\"%s\"\n", [str cString]);
 }
-- (void)ignorableWhitespace:(unichar *)_chars length:(int)_len {
+- (void)ignorableWhitespace:(unichar *)_chars length:(NSUInteger)_len {
   NSString *data;
   id tmp;
 
$OpenBSD$

fix from bug 2736

--- SoObjects/Mailer/NSString+Mail.m.orig	Sat Jun 14 20:49:31 2014
+++ SoObjects/Mailer/NSString+Mail.m	Sat Jun 14 20:50:22 2014
@@ -430,7 +430,7 @@
 }
 
 - (void) ignorableWhitespace: (unichar *) whitespaces
-                      length: (int) length
+                      length: (NSUInteger) length
 {
   showWhoWeAre();
 }
$OpenBSD$

fix from bug 2736

--- UI/MailPartViewers/UIxMailPartHTMLViewer.m.orig	Sat Jun 14 20:42:25 2014
+++ UI/MailPartViewers/UIxMailPartHTMLViewer.m	Sat Jun 14 20:45:09 2014
@@ -416,9 +416,9 @@ static NSData* _sanitizeContent(NSData *theData)
 }
 
 - (void) _appendStyle: (unichar *) _chars
-               length: (int) _len
+               length: (NSUInteger) _len
 {
-  unsigned int count, length;
+  NSUInteger count, length;
   unichar *start, *currentChar;
 
   start = _chars;
@@ -685,7 +685,7 @@ static NSData* _sanitizeContent(NSData *theData)
 }
 
 - (void) characters: (unichar *) _chars
-             length: (int) _len
+             length: (NSUInteger) _len
 {
   showWhoWeAre();
   if (!ignoredContent)
@@ -709,7 +709,7 @@ static NSData* _sanitizeContent(NSData *theData)
 }
 
 - (void) ignorableWhitespace: (unichar *) _chars
-                      length: (int) _len
+                      length: (NSUInteger) _len
 {
   showWhoWeAre();
 }
@@ -732,7 +732,7 @@ static NSData* _sanitizeContent(NSData *theData)
 
 /* SaxLexicalHandler */
 - (void) comment: (unichar *) _chars
-          length: (int) _len
+          length: (NSUInteger) _len
 {
   showWhoWeAre();
   if (inStyle)
sogo-fix-for-bug-2736.diff (2,892 bytes)   
buzzdee

buzzdee

2014-06-15 02:34

reporter  

sope-fix-for-bug-2736 (3,270 bytes)   
$OpenBSD$

patch from bug 2736

--- sope-xml/SaxObjC/SaxObjectDecoder.m.orig	Sat Jun 14 20:58:22 2014
+++ sope-xml/SaxObjC/SaxObjectDecoder.m	Sat Jun 14 20:59:57 2014
@@ -55,7 +55,7 @@ static BOOL debugOn = NO;
 - (void)start;
 - (void)stop;
 
-- (void)characters:(unichar *)_chars length:(int)_len;
+- (void)characters:(unichar *)_chars length:(NSUInteger)_len;
 
 @end
 
@@ -467,7 +467,7 @@ static Class  StringClass        = Nil;
   }
 }
 
-- (void)characters:(unichar *)_chars length:(int)_len {
+- (void)characters:(unichar *)_chars length:(NSUInteger)_len {
   if (self->flags.isMutableString) {
     NSString *tmp;
     
$OpenBSD$

patch from bug 2736

--- sope-xml/STXSaxDriver/STXSaxDriver.m.orig	Sat Jun 14 21:04:35 2014
+++ sope-xml/STXSaxDriver/STXSaxDriver.m	Sat Jun 14 21:05:20 2014
@@ -156,7 +156,7 @@ static BOOL debugOn = NO;
 }
 - (void)_characters:(NSString *)_chars {
   unichar      *buf;
-  unsigned int len;
+  NSUInteger   len;
   
   if ((len = [_chars length]) == 0) // TODO: may or may not be correct
     return;
$OpenBSD$

patch from bug 2736

--- sope-xml/libxmlSAXDriver/libxmlDocSAXDriver.m.orig	Sat Jun 14 21:05:33 2014
+++ sope-xml/libxmlSAXDriver/libxmlDocSAXDriver.m	Sat Jun 14 21:05:56 2014
@@ -424,7 +424,7 @@ static void setLocator(void *udata, xmlSAXLocatorPtr _
         return NO;
       }
       
-      [self->contentHandler characters:data length:(unsigned)(ts - data)];
+      [self->contentHandler characters:data length:(ts - data)];
       
       free(data);
     }
$OpenBSD$

patch from bug 2736

--- sope-xml/libxmlSAXDriver/libxmlHTMLSAXDriver.m.orig	Sat Jun 14 21:06:09 2014
+++ sope-xml/libxmlSAXDriver/libxmlHTMLSAXDriver.m	Sat Jun 14 21:06:52 2014
@@ -481,7 +481,7 @@ static void setLocator(void *udata, xmlSAXLocatorPtr _
 - (BOOL)processTextNode:(xmlNodePtr)_node {
   static unichar c = '\0';
   xmlChar  *chars;
-  unsigned len;
+  NSUInteger len;
   
   if (self->contentHandler == nil)
     return YES;
$OpenBSD$

patch from bug 2736

--- sope-xml/SaxObjC/SaxDefaultHandler+NSXML.m.orig	Thu Apr  3 16:09:55 2014
+++ sope-xml/SaxObjC/SaxDefaultHandler+NSXML.m	Sat Jun 14 21:02:08 2014
@@ -81,7 +81,7 @@ static BOOL doDebug = NO;
 
 - (void)parser:(id)_parser foundCharacters:(NSString *)_string {
   /* Note: expensive ..., decompose string into chars */
-  int     len;
+  NSUInteger     len;
   unichar *buf = NULL;
   
   if ((len = [_string length]) > 0) {
@@ -93,7 +93,7 @@ static BOOL doDebug = NO;
 }
 - (void)parser:(id)_parser foundIgnorableWhitespace:(NSString *)_ws {
   /* Note: expensive ..., decompose string into chars */
-  int     len;
+  NSUInteger     len;
   unichar *buf = NULL;
   
   if ((len = [_ws length]) > 0) {
$OpenBSD$

patch from bug 2736

--- sope-appserver/NGObjWeb/WebDAV/SaxDAVHandler.m.orig	Sat Jun 14 20:57:31 2014
+++ sope-appserver/NGObjWeb/WebDAV/SaxDAVHandler.m	Sat Jun 14 20:57:51 2014
@@ -937,8 +937,8 @@ static BOOL heavyLog = NO;
 
 /* CDATA */
 
-- (void)characters:(unichar *)_chars length:(int)_len {
-  if (heavyLog) [self logWithFormat:@"got %i chars", _len];
+- (void)characters:(unichar *)_chars length:(NSUInteger)_len {
+  if (heavyLog) [self logWithFormat:@"got %"PRIuPTR" chars", _len];
   
   if (_len > 0 && (self->cdata != nil)) {
     NSString *s;
sope-fix-for-bug-2736 (3,270 bytes)   
ludovic

ludovic

2014-06-16 15:33

administrator   ~0007216

https://github.com/inverse-inc/sope/commit/67cb8a515451f781b0bf0fcdfebefad20e63c973

and:

https://github.com/inverse-inc/sogo/commit/333b561a5932acbe66d5b62c8963dd166b9de7f2

Thanks!

Issue History

Date Modified Username Field Change
2014-04-25 05:56 buzzdee New Issue
2014-05-09 09:48 buzzdee File Added: appointment_content_in_database.txt
2014-05-09 09:48 buzzdee Note Added: 0007009
2014-06-10 07:16 buzzdee Note Added: 0007168
2014-06-10 07:17 buzzdee File Added: EVENTS.txt
2014-06-10 07:18 buzzdee Note Added: 0007169
2014-06-10 07:18 buzzdee Note Added: 0007170
2014-06-11 05:09 Christian Mack Product Version 2.2.3 => 2.2.4
2014-06-11 05:59 buzzdee Note Added: 0007178
2014-06-12 14:43 buzzdee Note Added: 0007206
2014-06-15 02:33 buzzdee Note Added: 0007209
2014-06-15 02:34 buzzdee File Added: sogo-fix-for-bug-2736.diff
2014-06-15 02:34 buzzdee File Added: sope-fix-for-bug-2736
2014-06-16 15:33 ludovic Target Version => 2.2.6
2014-06-16 15:33 ludovic Note Added: 0007216
2014-06-16 15:33 ludovic Status new => resolved
2014-06-16 15:33 ludovic Fixed in Version => 2.2.6
2014-06-16 15:33 ludovic Resolution open => fixed
2014-06-16 15:33 ludovic Assigned To => ludovic