Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHOTO broken since 0.9.7 #33

Closed
rfc2822 opened this issue Oct 18, 2015 · 6 comments
Closed

PHOTO broken since 0.9.7 #33

rfc2822 opened this issue Oct 18, 2015 · 6 comments

Comments

@rfc2822
Copy link
Contributor

rfc2822 commented Oct 18, 2015

I have updated the ez-vcard dependency in vcard4android from 0.9.6 to 0.9.7, which causes the generated PHOTO property to be broken, because there's an empty line after the end of the property (note the double [CR][LF] at the end):

BEGIN:VCARD[CR][LF]
VERSION:3.0[CR][LF]
UID:0bpdjwux-fy4i-y5pb-h6xd-k7rphj54jjen[CR][LF]
PRODID:+//IDN bitfire.at//DAVdroid/0.9vcard4android ez-vcard/0.9.7[CR][LF]
…
PHOTO;ENCODING=b;TYPE=jpeg:/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBwcJ[CR][LF]
CQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2w[CR][LF]
 BDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy[CR][LF]
 MjIyMjIyMjIyMjL/wAARCALQAtADASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAw[CR][LF]
QFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0Kx[CR][LF]
wRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3[CR][LF]
…
C7Mq9FJOB9B2p1shLkm3Z1PQqpNSarc29lcoIJJSW6llwPwrPeZoowYwUXrw5rn21Odx3R//2Q[CR][LF]
 ==[CR][LF]
[CR][LF]
REV:20151018T212428Z[CR][LF]
END:VCARD[CR][LF]

I'm quite sure that's because of some changes from 0.9.6 to 0.9.7 (because when setting the dependency back to 0.9.6, everything works again), but if you like, I can write a test.

@mangstadt
Copy link
Owner

Hey rfc2822,

By "broken" do you mean you tried to get Android to consume such a vCard, and it failed?

Yes, that empty line was added in 0.9.7. Someone reported an issue where Outlook 2010 sometimes has problems reading base64-encoded property values without a trailing empty line (see this issue). But if it's breaking on Android, then this issue should be revisited.

@rfc2822
Copy link
Contributor Author

rfc2822 commented Oct 20, 2015

By "broken" do you mean you tried to get Android to consume such a vCard, and it failed?

No, I mean that DAVdroid (which is an Android app, which is the only relation between this issue and Android) generated the VCard (using ez-vcard), sent it to a CardDAV server (using HTTP PUT). This server then refused to accept the VCard because it couldn't parse it.

Yes, that empty line was added in 0.9.7. Someone reported an issue where Outlook 2010 sometimes has problems reading base64-encoded property values without a trailing empty line (see this issue). But if it's breaking on Android, then this issue should be revisited.

The issue is not related to Android at all. The issue is that other VCard parsers can't parse this VCard because it contains an (illegal? didn't scan the specs for that, but I have never seen empty lines in VCard before) empty line.

@mangstadt
Copy link
Owner

This server then refused to accept the VCard because it couldn't parse it.

Well, that's not good. Do you know what CardDAV server is being used?

The specs definitely don't say to include an empty line after base64 property values. Sounds like a case of Outlook being "special".

@rfc2822
Copy link
Contributor Author

rfc2822 commented Oct 20, 2015

I believe it was the Oracle Communications Contacts server. However, I'd expect other servers to reject such VCards, too.

Would it be possible to enable (Outlook-)workarounds only on request?

@mangstadt
Copy link
Owner

That's what I'm thinking. Some sort of reader.setOutlookCompatibility(true).

@mangstadt
Copy link
Owner

Added VCardWriter.setOutlookCompatibility() method. Outlook compatibility is disabled by default.

Fixed in c8da9a4

MaximeMorel pushed a commit to MaximeMorel/davdroid that referenced this issue Nov 9, 2015
* fix lint warnings
* line-break too long messages of network trace logs
* DebugInfoActivity "send": attach log file instead if sending it as plain text
* revert to ez-vcard 0.9.6 because of mangstadt/ez-vcard#33
* German translations
mholtzberg pushed a commit to kilanka/kilanka-sync that referenced this issue Dec 6, 2017
* fix lint warnings
* line-break too long messages of network trace logs
* DebugInfoActivity "send": attach log file instead if sending it as plain text
* revert to ez-vcard 0.9.6 because of mangstadt/ez-vcard#33
* German translations
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants