Hello Patrick,

On 04.07.2013, at 12:01, Patrick Ohly <patrick.o...@intel.com> wrote:

> I just noticed one aspect of the example configs that I wasn't aware of:
> syncclient_sample_config.xml:      <field name="PHOTO" type="blob" 
> compare="never" merge="fillempty"/>
> 
> [...]
> 
> What was the rationale for using that mode for PHOTO? Is it for storages
> which store photo data after re-encoding it?

Exactly. For the mobile platforms I wrote clients, I never had an address book 
which did not somehow mangle (re-encode, resize, etc.) the data.

> With such a storage, the
> comparison would yield a false "field is different", causing unnecessary
> writes.

Yes.

> But with a storage that stores the data as-is, comparing it is
> better (IMHO), because modified data actually gets stored. The downside
> is that comparisons become more expensive.

That's another reason. Comparison causes the BLOB contents to be pulled from 
storage (server side), which can be quite expensive.

> Speaking of comparisons,  with EDS this is slightly tricky. Inlined data
> gets replaced with a file reference, so what the comparison really needs
> to do is not comparing
> "file:///tmp/testing/temp-testpim/data/evolution/addressbook/pim-manager-testsync-testcontacts-foo/photos/pas_id_51D53D1800000001_photo-file1.image%252Fjpeg"
>  against the binary data in the incoming item, but rather the content of that 
> file.
> 
> I probably need to write a <comparescript> for that, right? In that case
> compare="never" may be the right thing to do again, but I am not sure.

There's a compare="script" for that (might not be in the docs because that was 
added later, if I correctly remember somehow related to SyncEvolution...)

> Won't it lead to the situation again where MERGEFIELDS() incorrectly not
> marks an item as changed even though it was?

I haven't verified in the code right now, but I think that's what the "script" 
mode was supposed to avoid.

Best Regards,

Lukas
_______________________________________________
os-libsynthesis mailing list
os-libsynthesis@synthesis.ch
http://lists.synthesis.ch/mailman/listinfo/os-libsynthesis

Reply via email to