GNOME Bugzilla – Bug 655431
add-persona test fails
Last modified: 2011-07-29 20:04:46 UTC
After commit : commit 3862f876a9bef82f4fcf838a00c81ef5c57ae353 Author: Philip Withnall <philip@tecnocode.co.uk> Date: Mon Jun 13 10:54:23 2011 +0100 Bug 650414 — Need better APIs to handle image data Change AvatarDetails.avatar to have type LoadableIcon. By introducing a libfolks-wide avatar cache, propagate this change to all the backends. This breaks the API of AvatarDetails. Closes: bgo#650414 tests/eds/add-persona fails with: [rgs@andromeda eds]$ make check TESTS=add-persona add-persona add-persona.c add-persona.o add-persona.vala [rgs@andromeda eds]$ make check TESTS=add-persona make check-TESTS make[1]: Entering directory `/debian/rgs/devel/folks/tests/eds' /AddPersonaTests/test adding a persona to e-d-s : folks-CRITICAL **: folks_persona_build_uid: assertion `persona_id != NULL' failed
+ Trace 227915
The reason it happens is cause we are trying to get an E.Contact's UID in backends/eds/lib/edsf-persona-store.vala: private async void _set_contact_avatar (E.Contact contact, LoadableIcon? avatar) { var uid = Folks.Persona.build_uid (BACKEND_NAME, this.id, (string) Edsf.Persona._get_property_from_contact (contact, "id")); ..... Calling _set_contact_avatar() assumes that the E.Contact already has a UID.. which is not the case when we call it from add_persona_from_details(). More to the point, we shouldn't add images to the Avatar Cache as a result of the user setting the avatar property on a Persona or creating a new Persona, but as a consequence of e-d-s alerting us of a new Contact being created or a Contact being modified. This is the strategy we use with all property setters.
And more to the point, we are setting Contact's Photo via: // Cache the avatar so that it has a URI var uri = yield cache.store_avatar (uid, avatar); // Set the avatar on the contact var cp = new ContactPhoto (); cp.type = ContactPhotoType.URI; cp.set_uri (uri); which is supported by e-d-s of course, but I think they mostly use inlined photos (a quick git grep in Evo and e-d-s says so).
(In reply to comment #1) > And more to the point, we are setting Contact's Photo via: > > // Cache the avatar so that it has a URI > var uri = yield cache.store_avatar (uid, avatar); > > // Set the avatar on the contact > var cp = new ContactPhoto (); > cp.type = ContactPhotoType.URI; > cp.set_uri (uri); > > which is supported by e-d-s of course, but I think they mostly use inlined > photos (a quick git grep in Evo and e-d-s says so). In fact, I don't think we can safely do this, since it makes the EDS contact depend upon our cache -- which means it's no longer a cache (where we should be able to safely remove it at any point without data loss).
Thanks for the bug report. This particular bug has already been reported into our bug tracking system, but please feel free to report any further bugs you find. *** This bug has been marked as a duplicate of bug 655374 ***