[Tickets #12506] Re: Contacts sync with ActiveSync get duplicates and not sync

noreply at bugs.horde.org noreply at bugs.horde.org
Tue Jul 30 17:49:34 UTC 2013


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

Ticket URL: http://bugs.horde.org/ticket/12506
------------------------------------------------------------------------------
  Ticket             | 12506
  Updated By         | carlos.velasco at nimastelecom.com
  Summary            | Contacts sync with ActiveSync get duplicates and not
                     | sync
  Queue              | Synchronization
  Version            | Git master
  Type               | Bug
  State              | Not A Bug
  Priority           | 1. Low
  Milestone          |
  Patch              |
  Owners             |
------------------------------------------------------------------------------


carlos.velasco at nimastelecom.com (2013-07-30 17:49) wrote:

> This could be because the client is receiving *some* of the  
> responses before timing out, but if it decides the sync is  
> unsuccessful, it should not regenerate those ids.

No, don't think so, Android is closing TCP connection before receiving  
anything from Horde.

> What I don't understand yet though is why Turba is letting the  
> duplicates be added. There is code in Turba_Api::import() that is  
> supposed to reject entries that contain the exact same data (current  
> Git - Turba/lib/Api.php line 745. You can add some debug logging  
> there and compare the value of $content for each attempt.

Well, this is weird.

The $content is something like this:
array(61) {
   ["name"]=>
   string(6) "foo496"
   ["lastname"]=>
   string(0) ""
   ["firstname"]=>
   string(6) "foo496"
   ["middlenames"]=>
   string(0) ""
   ["alias"]=>
   string(0) ""
   ["nickname"]=>
   string(0) ""
   ["namePrefix"]=>
   string(0) ""
   ["nameSuffix"]=>
   string(0) ""
   ["homeStreet"]=>
   string(0) ""
   ["homeCity"]=>
   string(0) ""
   ["homeProvince"]=>
   string(0) ""
   ["homePostalCode"]=>
   string(0) ""
   ["homeCountryFree"]=>
   string(0) ""
   ["otherStreet"]=>
   string(0) ""
   ["otherCity"]=>
   string(0) ""
   ["otherProvince"]=>
   string(0) ""
   ["otherPostalCode"]=>
   string(0) ""
   ["otherCountryFree"]=>
   string(0) ""
   ["workStreet"]=>
   string(0) ""
   ["workCity"]=>
   string(0) ""
   ["workProvince"]=>
   string(0) ""
   ["workPostalCode"]=>
   string(0) ""
   ["workCountryFree"]=>
   string(0) ""
   ["title"]=>
   string(0) ""
   ["company"]=>
   string(0) ""
   ["department"]=>
   string(0) ""
   ["office"]=>
   string(0) ""
   ["spouse"]=>
   string(0) ""
   ["website"]=>
   string(0) ""
   ["assistant"]=>
   string(0) ""
   ["manager"]=>
   string(0) ""
   ["yomifirstname"]=>
   string(0) ""
   ["yomilastname"]=>
   string(0) ""
   ["imaddress"]=>
   string(0) ""
   ["imaddress2"]=>
   string(0) ""
   ["imaddress3"]=>
   string(0) ""
   ["homePhone"]=>
   string(11) "+3466666496"
   ["homePhone2"]=>
   string(0) ""
   ["workPhone"]=>
   string(0) ""
   ["workPhone2"]=>
   string(0) ""
   ["fax"]=>
   string(0) ""
   ["homeFax"]=>
   string(0) ""
   ["pager"]=>
   string(0) ""
   ["cellPhone"]=>
   string(0) ""
   ["carPhone"]=>
   string(0) ""
   ["assistPhone"]=>
   string(0) ""
   ["companyPhone"]=>
   string(0) ""
   ["radioPhone"]=>
   string(0) ""
   ["notes"]=>
   string(0) ""
   ["photo"]=>
   string(0) ""
   ["emails"]=>
   string(2) ",,"
   ["email"]=>
   NULL
   ["homeEmail"]=>
   NULL
   ["workEmail"]=>
   NULL
   ["category"]=>
   string(0) ""
   ["children"]=>
   string(0) ""
   ["birthday"]=>
   NULL
   ["anniversary"]=>
   NULL
   ["homeCountry"]=>
   NULL
   ["workCountry"]=>
   NULL
   ["otherCountry"]=>
   NULL
}

But the search returns 0. Why?

The complete SQL is:
         SELECT object_id, owner_id, object_type, object_members, object_uid,
           object_firstname, object_lastname, object_middlenames,
           object_nameprefix, object_namesuffix, object_alias,
           object_yomifirstname, object_yomilastname, object_bday,
           object_anniversary, object_spouse, object_photo, object_phototype,
           object_homestreet, object_homepob, object_homecity,
           object_homeprovince, object_homepostalcode, object_homecountry,
           object_workstreet, object_workpob, object_workcity,
           object_workprovince, object_workpostalcode, object_workcountry,
           object_otherstreet, object_otherpob, object_othercity,
           object_otherprovince, object_otherpostalcode, object_othercountry,
           object_department, object_manager, object_assistant, object_tz,
           object_homeemail, object_homephone, object_homephone2,  
object_homefax,
           object_workphone, object_workphone2, object_cellphone,
           object_carphone, object_radiophone, object_companyphone,
           object_assistantphone, object_fax, object_pager, object_title,
           object_role, object_company, object_logo, object_logotype,
           object_category, object_notes, object_url, object_freebusyurl,
           object_pgppublickey, object_smimepublickey, object_imaddress,
           object_imaddress2, object_imaddress3, object_workemail FROM
           turba_objects WHERE (owner_id = 'testas at nimastelecom.com' AND
           ((LOWER(object_nameprefix) LIKE LOWER('%foo73%') OR
           LOWER(object_firstname) LIKE LOWER('%foo73%') OR
           LOWER(object_middlenames) LIKE LOWER('%foo73%') OR
           LOWER(object_lastname) LIKE LOWER('%foo73%') OR
           LOWER(object_namesuffix) LIKE LOWER('%foo73%')) AND
           LOWER(object_lastname) LIKE LOWER('%%') AND LOWER(object_firstname)
           LIKE LOWER('%foo73%') AND LOWER(object_middlenames) LIKE LOWER('%%')
           AND LOWER(object_alias) LIKE LOWER('%%') AND  
LOWER(object_nameprefix)
           LIKE LOWER('%%') AND LOWER(object_namesuffix) LIKE LOWER('%%') AND
           LOWER(object_homestreet) LIKE LOWER('%%') AND LOWER(object_homecity)
           LIKE LOWER('%%') AND LOWER(object_homeprovince) LIKE LOWER('%%') AND
           LOWER(object_homepostalcode) LIKE LOWER('%%') AND
           LOWER(object_otherstreet) LIKE LOWER('%%') AND  
LOWER(object_othercity)
           LIKE LOWER('%%') AND LOWER(object_otherprovince) LIKE  
LOWER('%%') AND
           LOWER(object_otherpostalcode) LIKE LOWER('%%') AND
           LOWER(object_workstreet) LIKE LOWER('%%') AND LOWER(object_workcity)
           LIKE LOWER('%%') AND LOWER(object_workprovince) LIKE LOWER('%%') AND
           LOWER(object_workpostalcode) LIKE LOWER('%%') AND  
LOWER(object_title)
           LIKE LOWER('%%') AND LOWER(object_company) LIKE LOWER('%%') AND
           LOWER(object_department) LIKE LOWER('%%') AND LOWER(object_spouse)
           LIKE LOWER('%%') AND LOWER(object_url) LIKE LOWER('%%') AND
           LOWER(object_assistant) LIKE LOWER('%%') AND LOWER(object_manager)
           LIKE LOWER('%%') AND LOWER(object_yomifirstname) LIKE  
LOWER('%%') AND
           LOWER(object_yomilastname) LIKE LOWER('%%') AND
           LOWER(object_imaddress) LIKE LOWER('%%') AND  
LOWER(object_imaddress2)
           LIKE LOWER('%%') AND LOWER(object_imaddress3) LIKE LOWER('%%') AND
           LOWER(object_homephone) LIKE LOWER('%+346666673%') AND
           LOWER(object_homephone2) LIKE LOWER('%%') AND  
LOWER(object_workphone)
           LIKE LOWER('%%') AND LOWER(object_workphone2) LIKE LOWER('%%') AND
           LOWER(object_fax) LIKE LOWER('%%') AND LOWER(object_homefax) LIKE
           LOWER('%%') AND LOWER(object_pager) LIKE LOWER('%%') AND
           LOWER(object_cellphone) LIKE LOWER('%%') AND LOWER(object_carphone)
           LIKE LOWER('%%') AND LOWER(object_assistantphone) LIKE  
LOWER('%%') AND
           LOWER(object_companyphone) LIKE LOWER('%%') AND
           LOWER(object_radiophone) LIKE LOWER('%%') AND  
LOWER(object_notes) LIKE
           LOWER('%%') AND LOWER(object_homeemail) LIKE LOWER('%%') AND
           LOWER(object_homeemail) LIKE LOWER('%%') AND LOWER(object_workemail)
           LIKE LOWER('%%') AND LOWER(object_category) LIKE LOWER('%%') AND
           LOWER(object_bday) LIKE LOWER('%%') AND  
LOWER(object_anniversary) LIKE
           LOWER('%%') AND LOWER(object_homecountry) LIKE LOWER('%%') AND
           LOWER(object_workcountry) LIKE LOWER('%%') AND
           LOWER(object_othercountry) LIKE LOWER('%%')));


Returns 0 because in the "LOWER(object_homeemail) LIKE LOWER('%%')",  
this field is NULL in these contacts and NULL does not match in LIKE  
wildcards.
Same for object_workemail.

These fields are mapped in my backend local.
$cfgSources['localsql']['map']['email'] = 'object_homeemail';
$cfgSources['localsql']['map']['homeEmail'] = 'object_homeemail';
$cfgSources['localsql']['map']['workEmail'] = 'object_workemail';

And are as type email in attributes.






More information about the bugs mailing list