[Tickets #14018] Kronolith syncml duplicate event detection broken

noreply at bugs.horde.org noreply at bugs.horde.org
Fri Jun 19 15:06:34 UTC 2015


DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.

Ticket URL: https://bugs.horde.org/ticket/14018
------------------------------------------------------------------------------
  Ticket             | 14018
  Created By         | horde at albasoft.com
  Summary            | Kronolith syncml duplicate event detection broken
  Queue              | Synchronization
  Version            | Git master
  Type               | Bug
  State              | Unconfirmed
  Priority           | 1. Low
  Milestone          |
  Patch              | 1
  Owners             |
------------------------------------------------------------------------------


horde at albasoft.com (2015-06-19 15:06) wrote:

A broken funambol syncml for Outlook request was creating thousands of  
repeated events in kronolith_events database.

I've found that there is code that could be preventing this, but it's broken.
New events from syncml pass through  "_addiCalEvent" function prior to  
be inserted in database as new events. And there is a search for an  
existing event match in database:
   $result = $driver->search($event);
   // Check if the match really is an exact match:

But $driver->search returns an array of arrays of events, indexed by  
date, while this code will deal with an array of events.
A loop like "foreach ($result as $match)" will have a array of events,  
not a single event. It will never get a match an the event will always  
be inserted as new. In fact, search actually returns thousands of  
duplicated events from my database, but new is inserted anyway.

There's also another bug in this function:
     if ($match->start == $event->start &&
         $match->end == $event->end &&
         $match->title == $event->title &&

is incorrect, as $match->start  is a date object. Should be something like:
     if ($match->start->compareDateTime($event->start) == 0 &&
         $match->end->compareDateTime($event->end) == 0 &&
         $match->title == $event->title &&

Patch is attached to clarify.



horde at albasoft.com (2015-06-19 15:06) uploaded:  
hordewm5-kronolith-EventExists.patch

https://bugs.horde.org/h/services/download/?app=whups&actionID=download_file&file=hordewm5-kronolith-EventExists.patch&ticket=14018&fn=%2Fhordewm5-kronolith-EventExists.patch





More information about the bugs mailing list