View Issue Details

IDProjectCategoryView StatusLast Update
0000690SOGoWeb Calendarpublic2010-08-03 10:47
Reporterib_pl Assigned Toludovic  
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
Product Version1.2.2 
Target Version1.3.1Fixed in Version1.3.1 
Summary0000690: Empty rows in event text after import from ics file
Description

Hello,

After importing the attached test_import_file.ics file to calendar (SOGo 1.2.2 web interface) the event text in MySQL database becomes corrupted - I can see empty line between two ATTENDEE lines (see MySQL event dump in the attached TXT file).

Corrupted event does not break SOGo functionality - you can open/edit it in SOGo web interface. But when you try to synchronize this event using funambol (i'm using http://inverse.ca/downloads/tmp/funambol-sogo-1.0.8.s4j.20100323 and funambol 8.5.2 server) an error occurs in ds-server.log...

com.funambol.common.pim.icalendar.TokenMgrError: Lexical error at line 19, column 1. Encountered: "\r" (13), after : "\r"

...and synchronization error occurs on client side (Outlook, Symbian, etc.).

I can see similar problem on pages
http://permalink.gmane.org/gmane.comp.cms.opengroupware.sogo/5593
http://comments.gmane.org/gmane.comp.cms.opengroupware.sogo/5331

Thank you for great application,
Pawel

TagsNo tags attached.

Activities

2010-07-16 10:55

 

ib_pl

ib_pl

2010-07-17 15:14

reporter   ~0001195

Last edited: 2010-07-17 15:16

I guess the problem is in the /SOPE/NGCards/NSString+NGCards.m/foldedForVersitCards's way of folding strings.

It does not take into account that ical line ends with 2 chars <CR><LF>. When line ends on folding boundary (folding between <CR> and <LF>), the folded string ends with <CR><CR><LF><LF> and causes an error on funambol sync.

See attached patch (SOGo-1.2.2-fold-fix.patch) - it resolved this issue for me. Please verify it and consider fixing it.

Thank you,
Pawel

2010-07-17 15:14

 

SOGo-1.2.2-fold-fix.patch (882 bytes)   
diff -Nur SOGo-1.2.2/SOPE/NGCards/NSString+NGCards.m SOGo-1.2.2-fold-fix/SOPE/NGCards/NSString+NGCards.m
--- SOGo-1.2.2/SOPE/NGCards/NSString+NGCards.m	2010-02-17 16:44:00.000000000 +0100
+++ SOGo-1.2.2-fold-fix/SOPE/NGCards/NSString+NGCards.m	2010-07-17 15:32:44.000000000 +0200
@@ -51,7 +51,7 @@
   foldedString = [NSMutableString string];
 
   length = [self length];
-  if (length < 76)
+  if (length < 77)
     [foldedString appendString: self];
   else
     {
@@ -59,7 +59,7 @@
       [foldedString appendFormat: @"%@\r\n",
                     [self substringWithRange: subStringRange]];
       subStringRange = NSMakeRange (75, 74);
-      while ((length - subStringRange.location) > 74)
+      while ((length - subStringRange.location) > 75)
         {
           [foldedString appendFormat: @" %@\r\n",
                         [self substringWithRange: subStringRange]];
SOGo-1.2.2-fold-fix.patch (882 bytes)   
chris_hobbs

chris_hobbs

2010-07-28 19:42

reporter   ~0001256

I can confirm that this is happening on calendar import. I exported my calendar from the web, removed the blank lines using vim (%s/\n+/\r/g), truncated my calendar table, and then re-imported the .ics file with the blank lines removed. Funambol fails to sync my calendar with the same error identified by the reporter.

If I re-export the calendar and grep the .ics for '\r\r', I find 79 hits in my 3600 items. Going to go remove them by hand and hope they're all in the past :-)

chris_hobbs

chris_hobbs

2010-08-02 14:03

reporter   ~0001265

I did come up with a crude way of fixing this problem after the fact:

mysqldump -u root -ptopsecr3t sogo sogousername0037dead777 | perl -pi -e 's/\r\r/\r/g' | mysql -u root -ptopsecr3t sogo

This dumps the user's calendar table, strips out the duplicated \r, and then reloads the table. Would definitely be safest to shutdown SOGo when running this, to prevent the possibility of a new entry being created between the dump and the reload.

ludovic

ludovic

2010-08-03 10:47

administrator   ~0001267

Fixed in the ca.inverse.sogo.1_3_1 branch.

Issue History

Date Modified Username Field Change
2010-07-16 10:55 ib_pl New Issue
2010-07-16 10:55 ib_pl File Added: sogo122_import_bug_sample.zip
2010-07-17 15:14 ib_pl Note Added: 0001195
2010-07-17 15:14 ib_pl File Added: SOGo-1.2.2-fold-fix.patch
2010-07-17 15:15 ib_pl Note Edited: 0001195
2010-07-17 15:16 ib_pl Note Edited: 0001195
2010-07-27 11:47 ludovic Target Version => 1.3.1
2010-07-28 19:42 chris_hobbs Note Added: 0001256
2010-07-28 19:48 ludovic Status new => assigned
2010-07-28 19:48 ludovic Assigned To => ludovic
2010-08-02 14:03 chris_hobbs Note Added: 0001265
2010-08-03 10:47 ludovic Note Added: 0001267
2010-08-03 10:47 ludovic Status assigned => resolved
2010-08-03 10:47 ludovic Fixed in Version => 1.3.1
2010-08-03 10:47 ludovic Resolution open => fixed