After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 792653 - Use GetUserPhoto for GAL contacts
Use GetUserPhoto for GAL contacts
Status: RESOLVED FIXED
Product: evolution-ews
Classification: Other
Component: Contacts (Global Address List)
3.26.x
Other Linux
: Normal normal
: ---
Assigned To: Evolution EWS maintainer(s)
Evolution EWS maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2018-01-18 17:37 UTC by Paul Stejskal
Modified: 2018-05-30 11:33 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Paul Stejskal 2018-01-18 17:37:41 UTC
See https://bugzilla.gnome.org/show_bug.cgi?id=792411 for more info.

How should we handle searching for contact photos? My vote: only bring up photo once the particular contact clicked. Don't fetch each picture just minimal contact info then when clicking pull in full contact info.
Comment 1 Milan Crha 2018-01-24 15:28:44 UTC
Thanks for a bug report. The "contact clicked" is a no-op in the evolution(-data-server) world. The contacts are downloaded to the local cache and then provided to any client (not only evolution) as needed (as the clients ask for them when using some filtering on the book).

The closest to what you suggests is an Online GAL, where contacts are returned only when searching for them. The code can use GetUserPhoto() for the returned contacts, or to some subset of them, like up to the first 10, but that can slow the response of the book significantly. The code can schedule the photo download and update the contacts if/when they have any photo, thus, maybe, it's doable at least this way.
Comment 2 Milan Crha 2018-04-20 10:14:56 UTC
This is Exchange 2013+ material and even it is turned on by default (in GAL book Properties, option "Fetch contact photos"), I'm still afraid of rejects on the server side, thus it's possible the default will be changed in the future.

As it currently works, the offline GAL tries to get photo for each new/modified contact, unless the server rejects the GetUserPhoto request with ServerBusy error, in which case the tries are stopped. It is also tried to fetch the photo when searching for a contact, it doesn't matter whether in online or offline GAL, but only up to ten times, also until ServerBusy and only once per day for each contact. It's because there is no indication whether the contact has a picture or not. While offline GAL can drop the photo, the online GAL cannot, because any already downloaded photo is copied into the newly resolved contact, thus it's carried over ad infinity/until the local cache is deleted manually, regardless the existence of the photo on the server. Similarly, when the photo changes on the server the online GAL will not notice it, it'll still use the old photo. This is important, because I really do not want to piss off the Exchange server, the less office365.com server.

Created commit 11cf0fa in ews master (3.29.2+)
Comment 3 Joakim Tjernlund 2018-04-20 14:46:06 UTC
Nice! Any chance we can have this in 3.28 too?
Comment 4 Milan Crha 2018-04-23 09:18:09 UTC
No, it adds new UI and new translatable strings, which is a no-go for the stable branches.
Comment 5 Joakim Tjernlund 2018-05-30 07:26:29 UTC
Just upgraded to 3.29.2(built it using the same "ebuild" as for 3.28.2)
and wanted to see contact photos for my GAL(offline) in o365
but I cannot find any, nor a a config knob to toggle.
I must be missing something?
Comment 6 Milan Crha 2018-05-30 08:04:25 UTC
When you restart evolution, and all background processes of evolution-data-server, which can be done with `evolution --force-shutdown`, then in the context-menu of the GAL, pick Properties, and there's the option. Change it, confirm the change, then right-click again and use Refresh and/or search for some contact which should have the photo. It will be updated with it when returned from the server.
Comment 7 Joakim Tjernlund 2018-05-30 08:39:10 UTC
Right, I actually screwed up. I installed 3.29.3 on another machine than I ran my
evo on :(

Fixing that, I now have the option for photos. However, when opening my
offline GAL I get the error msg:
  The reported error was “Failed to update GAL:404 Not Found”.
and no photos. Debug settings for that?
Comment 8 Joakim Tjernlund 2018-05-30 10:33:37 UTC
After a few restarts and a reboot it started to work. Now I see photos in
GAL contacts list, thanks :)
Comment 9 Milan Crha 2018-05-30 11:33:19 UTC
(In reply to Joakim Tjernlund from comment #7)
> However, when opening my offline GAL I get the error msg:
>   The reported error was “Failed to update GAL:404 Not Found”.

Hrm, it should not do that.

(In reply to Joakim Tjernlund from comment #8)
> After a few restarts and a reboot it started to work.

It looks like more background processes required restart.

Good you made it working.