nextcloud / contacts

📇 Contacts app for Nextcloud
https://apps.nextcloud.com/apps/contacts
GNU Affero General Public License v3.0
569 stars 173 forks source link

Storing contact avatars seems to have changed and broke for certain clients. #1195

Closed RobertZenz closed 5 years ago

RobertZenz commented 5 years ago

I've just noticed that storing the avatar of contacts seems to have changed in the last half year or so. Previously the avatars of contacts where stored like this in the vcf file:

PHOTO;TYPE=PNG;ENCODING=b:AVATAR_IN_BASE64_FOLLOWS

With the latest version (3.1.3) avatars are being stored like this:

PHOTO;VALUE=URI:data:image/png;base64,AVATAR_IN_BASE64_FOLLOWS

This, however, seems to break in certain clients (UBports being one of them) as they will not recognize the avatars.

Was that a consciousness change or did I miss something here?

skjnldsv commented 5 years ago

Vcard 3 I presume? Duplicate of #1140

RobertZenz commented 5 years ago

I just noticed that you can add Nextcloud Mail to the list of application with which avatars have stopped working. The old ones still work fine, all newly assigned ones do not show up in the mail application.

So, this might require a second look as it is not about a third-party application storing avatars differently then contacts expects, but contacts storing it differently then everybody else expects.

skjnldsv commented 5 years ago

@RobertZenz are the avatar url failing for you? can you check by appending ?photo to the direct dav url of the problematic vcards? :)

Does it generate any error in your nextcloud logs?

RobertZenz commented 5 years ago

mail tries to fetch the photo but receives a 404.

How do I retrieve the DAV URL of a single card?

No, there's nothing in the log.

skjnldsv commented 5 years ago

How do I retrieve the DAV URL of a single card?

this is the download link :) Instead of clicking you can right click and copy :)

RobertZenz commented 5 years ago

Okay, that gives me the image (even though it is wrongly named, it's got the name and extension of the vcf file).

skjnldsv commented 5 years ago

Hum, so loading the image works, but not in contacts? Can you check if this is a duplicate of #1140 or not?

RobertZenz commented 5 years ago

No, it works fine in contacts, it doesn't work in mail and other third-party clients in which it used to work.

skjnldsv commented 5 years ago

So, if it works fine in contacts, what is this issue about? :see_no_evil: :grin:

RobertZenz commented 5 years ago

That it used to work fine in all applications, now it doesn't. So something changed in contacts that broke it for these applications. And, actually, all I wanted to know is whether that was a deliberate change along the way or if it was a mistake.

skjnldsv commented 5 years ago

Aaah, ok The contacts app doesn't have anything to do with other applications :) You will have to open dedicated issues on those apps :wink:

RobertZenz commented 5 years ago

Okay, I'll try once again: Did you change anything, rather recently, regarding storing of the avatar which might have broken other applications? Like changed the vCard version or the version of the library which you might use?

skjnldsv commented 5 years ago

Ah! Make more sense, sorry :) Well, with the 3.x.x version, we are now properly styoring photo exept for some vcard reader on vcard3 versions :see_no_evil: See the mentioned issue above ;)

RobertZenz commented 5 years ago

Just for your information, this is broken on your end.

I just found the time to do some more tests, and when I replace the "URI" variant of the avatar with the "TYPE PNG" one, everything is working as expected for everyone. The avatars are then also reachable through the web address again, which means that the Nextcloud Mail client can also load and display them again, which has stopped working.

On another note, it's not always stored like that. I created a new contact and set the avatar, it was stored in the "TYPE PNG" variant. However, the card was still of version 3.0, so I'm not sure why that got stored different.

skjnldsv commented 5 years ago

Yes @RobertZenz you're 100% right This is what https://github.com/nextcloud/contacts/issues/1140 is all about :) vcard3 are using a slightly different syntax, and we're not compliant :(

skjnldsv commented 5 years ago

Fix in https://github.com/nextcloud/contacts/pull/1239