Bug 74342

Summary: [Patch] Missing UID in calendar events when syncing with funambol
Product: SyncEvolution Reporter: gordon
Component: SyncEvolutionAssignee: Patrick Ohly <patrick.ohly>
Status: RESOLVED FIXED QA Contact:
Severity: blocker    
Priority: medium CC: syncevolution-issues
Version: 1.3.99.3   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: The patch adds a UUID when one is missing.

Description gordon 2014-02-01 21:44:45 UTC
Created attachment 93198 [details]
The patch adds a UUID when one is missing.

I'm syncing KOrganizer and my mobile via funambol 10.0.0.2 and syncevolution 1.3.99.6. The calendar entries received by syncevolution from funambol lack a UUID which akonadi doesn't like. It throws a warning and Kontact does not display those entries.

This is luckily fixed with the attached patch, as suggested by Patrick.
Comment 1 Patrick Ohly 2014-02-14 10:33:46 UTC
In the corresponding discussion over at https://syncevolution.org/wiki/kde-akonadi#comment-871 you said that you also had to remove the stripping of the UID in 03funambol.xml.

I need to check whether that is really okay with the current Funambol One Media server before I am comfortable merging this.
Comment 2 gordon 2014-02-14 21:02:23 UTC
I'm actually using this solely with the attached patch. The UID stripping is still in place.

The scenario that I advised me to test works just fine that way.
Comment 3 gordon 2014-02-14 21:03:02 UTC
...that *you* advised me, lol :-)
Comment 4 Patrick Ohly 2014-02-16 19:54:17 UTC
I ran a nightly test with this patch included and found that it breaks several tests, for example:

https://nightly.syncevolution.org/2014-02-15-14-15_all/testing-amd64/10-googlecalendar/Client_Sync_eds_event_testItems.log.html
...
-------------------------------------------------------------------------------
BEGIN:VCALENDAR                          BEGIN:VCALENDAR
VERSION:2.0                              VERSION:2.0
  BEGIN:VEVENT                             BEGIN:VEVENT
  SUMMARY:two day event                    SUMMARY:two day event
  DTEND;VALUE=DATE:20060408                DTEND;VALUE=DATE:20060408
  DTSTART;VALUE=DATE:20060406              DTSTART;VALUE=DATE:20060406
  UID:20060416T204047Z-4272-727-1-245  |   UID:syuid642838.212259308803453
   @gollum                             <
  END:VEVENT                               END:VEVENT
END:VCALENDAR                            END:VCALENDAR
-------------------------------------------------------------------------------

https://nightly.syncevolution.org/2014-02-15-14-15_all/testing-amd64/16-davical/Client_Sync_eds_task_testManyItems.log.html

[DEBUG 00:02:47] ClientTest.cpp:752: starting equal = config.m_compare(client, sourceFile, copyFile)
 deleteall.init deleteall.twoway send refresh refresh twinning

Client_Sync_eds_task_testManyItems.A.test.dat | Client_Sync_eds_task_testManyItems.B.test.dat
                     only in left file <
                                       > only in right file
-------------------------------------------------------------------------------
BEGIN:VCALENDAR                          BEGIN:VCALENDAR
VERSION:2.0                              VERSION:2.0
  BEGIN:VTODO                              BEGIN:VTODO
  SUMMARY:000-do me                        SUMMARY:000-do me
  DESCRIPTION:xxxxxxxxxxxxxxxxxxxxxxx      DESCRIPTION:xxxxxxxxxxxxxxxxxxxxxxx
   xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx      xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
   xxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx      xxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
   xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nx      xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nx
   xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx      xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
   xxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxx      xxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxx
   xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx      xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
   xxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxx      xxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxx
   xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx      xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
   xxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxx      xxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxx
   xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx      xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
   xxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxx      xxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxx
   xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx      xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
   xx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx      xx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
   xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxx      xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxx
   xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx      xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
   xxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxx      xxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxx
   xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx      xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
   xxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxx      xxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxx
   xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx      xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
   xxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxx      xxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxx
   xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx      xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
   xxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxx      xxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxx
   xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx      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xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
   xxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxx      xxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxx
   xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx      xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
   xxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxx      xxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxx
   xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx      xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
   xxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxx      xxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxx
   xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx      xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
   xxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxx      xxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxx
   xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\      xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\
   nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx      nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
   xxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxx      xxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxx
   xxxxxxxxxxx\nxto be done                 xxxxxxxxxxx\nxto be done
  PRIORITY:0                               PRIORITY:0
  STATUS:NEEDS-ACTION                      STATUS:NEEDS-ACTION
  UID:syuid060245.212259327652823      |   UID:syuid125355.212259327680020
  END:VTODO                            <
END:VCALENDAR                          <
-------------------------------------------------------------------------------
...


Looks like a more complex solution will be needed. In the meantime I'll release SyncEvolution 1.4 without this patch.
Comment 5 Patrick Ohly 2014-03-18 13:45:11 UTC
Darn, "if (!UID)" is not valid in Synthesis scripts because it always evaluates to "true". This here is the correct line:

  if (UID == EMPTY) { UID = newuid(); }

Gordon, just for the sake of completeness, can you try that?
Comment 6 Patrick Ohly 2014-04-01 13:35:10 UTC
Fix is in master and SyncEvolution 1.4.1 (currently available as individual download and from the "unstable" repo on syncevolution.org).
Comment 7 gordon 2014-04-01 18:45:47 UTC
Thanks for your help. I just patched the script according to your suggestion and will monitor for problems.

FWIW, with the previous change (!UID), everything appeared to work fine. I had one single occurrence of a conflict where KOrganizer showed me two events with two different UIDs (nicely  showed me a diff of the two versions and let me choose to keep one).

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.