CardDav fails to save changes to google, if name is not set on the card
Categories
(Thunderbird :: Address Book, defect)
Tracking
(thunderbird_esr102 fixed, thunderbird106 fixed)
People
(Reporter: phil, Assigned: darktrojan)
Details
Attachments
(1 file)
48 bytes,
text/x-phabricator-request
|
wsmwk
:
approval-comm-beta+
wsmwk
:
approval-comm-esr102+
|
Details | Review |
Steps to reproduce:
When setting up a new CardDav address book, changes fail to save back to the server due to 400 Bad Request.
This is on Thunderbird 102.1.2.
Here's an example from the error console:
PUT
https://www.googleapis.com/carddav/v1/principals/phil@ipom.com/lists/default/363986d2-6b5a-468f-8010-d5f9d0603b99.vcf
[HTTP/2 400 Bad Request 90ms]
PUT
https://www.googleapis.com/carddav/v1/principals/phil@ipom.com/lists/default/363986d2-6b5a-468f-8010-d5f9d0603b99.vcf
Status
400
Bad Request
VersionHTTP/2
Transferred630 B (127 B size)
alt-svc
h3=":443"; ma=2592000,h3-29=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"
cache-control
private
content-encoding
gzip
content-length
129
content-type
application/json; charset=UTF-8
date
Thu, 22 Sep 2022 22:12:04 GMT
server
ESF
vary
Origin
vary
X-Origin
vary
Referer
x-content-type-options
nosniff
X-Firefox-Spdy
h2
x-frame-options
SAMEORIGIN
x-xss-protection
0
Accept
*/*
Accept-Encoding
gzip, deflate, br
Accept-Language
en-US,en;q=0.5
Authorization
Bearer XXXXX
Connection
keep-alive
Content-Length
131
Content-Type
text/vcard
Host
www.googleapis.com
Origin
https://www.googleapis.com
Sec-Fetch-Dest
empty
Sec-Fetch-Mode
no-cors
Sec-Fetch-Site
same-origin
TE
trailers
User-Agent
Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.1.2
Here's another example:
PUThttps://www.googleapis.com/carddav/v1/principals/phil@ipom.com/lists/default/0037b4e4-f4e3-4e4a-9a88-b8543dc4aa50.vcf
[HTTP/2 400 Bad Request 87ms]
PUT
https://www.googleapis.com/carddav/v1/principals/phil@ipom.com/lists/default/0037b4e4-f4e3-4e4a-9a88-b8543dc4aa50.vcf
Status
400
Bad Request
VersionHTTP/2
Transferred630 B (127 B size)
alt-svc
h3=":443"; ma=2592000,h3-29=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"
cache-control
private
content-encoding
gzip
content-length
129
content-type
application/json; charset=UTF-8
date
Thu, 22 Sep 2022 22:12:04 GMT
server
ESF
vary
Origin
vary
X-Origin
vary
Referer
x-content-type-options
nosniff
X-Firefox-Spdy
h2
x-frame-options
SAMEORIGIN
x-xss-protection
0
Accept
*/*
Accept-Encoding
gzip, deflate, br
Accept-Language
en-US,en;q=0.5
Authorization
Bearer XXXX
Connection
keep-alive
Content-Length
139
Content-Type
text/vcard
Host
www.googleapis.com
Origin
https://www.googleapis.com
Sec-Fetch-Dest
empty
Sec-Fetch-Mode
no-cors
Sec-Fetch-Site
same-origin
TE
trailers
User-Agent
Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.1.2
There's also this error after the bad requests:
[Exception... "Sending card to the server failed, response was 400 Bad Request" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: resource:///modules/CardDAVDirectory.jsm :: _sendCardToServer :: line 400" data: no] 4 CardDAVDirectory.jsm:400:24
_sendCardToServer resource:///modules/CardDAVDirectory.jsm:400
InterpretGeneratorResume self-hosted:1422
AsyncFunctionNext self-hosted:632
Actual results:
400, bad request, see above.
Expected results:
200, and a saved card.
Assignee | ||
Comment 1•3 years ago
|
||
I can't reproduce this. Adding cards to a Google address book seems to work for me. However we've had a lot of reports about problems with Google calendars which make me suspect something is up with the Google servers, and maybe this is related.
Could you open the Developer Toolbox (under Tools > Developer Tools), go to the Network tab, then reproduce the problem? I'd like to see the card you're sending and the complete response from the server, which probably looks a bit like this:
<?xml version="1.0" encoding="UTF-8"?>
<D:error xmlns:D="DAV:">
<D:valid-sync-token/>
</D:error>
Reporter | ||
Comment 2•3 years ago
|
||
I can't reproduce it making a random card. But I can if I save 3 address from an email, which then go into the "local" address book, and then I drag them to the Google address book. I'll try to also get that debug for you.
Reporter | ||
Comment 3•3 years ago
|
||
OK I repro'd, two cards were sent, both got 400s.
The request was definitely not in
BEGIN:VCARD
VERSION:4.0
FN:<firstname> <last name>
EMAIL;PREF=1:<lasntame>@<domain>com
UID:ebaf8806-a83c-44a8-9e00-420ce20408f1
END:VCARD
Response:
{
"error": {
"code": 400,
"message": "Request contains an invalid argument.",
"status": "INVALID_ARGUMENT"
}
}
Assignee | ||
Comment 4•3 years ago
|
||
Oh wow, that's weird. I reproduced the issue, and it seems to be the lack of a name (N
, not FN
) that Google doesn't like.
Assignee | ||
Comment 5•3 years ago
|
||
RFC2426 (vCard 3, which Google uses) specifies that the N
property is required but RFC6350 (vCard 4) does not. It appears that Google enforces this.
This can't be fixed just by making the vCard serialiser add an N
property to all version 3 cards, because sending a version 4 card to Google is a reasonable thing to do and it works otherwise.
Updated•3 years ago
|
Reporter | ||
Comment 6•3 years ago
|
||
Oh thanks @darktrojan! That gives me a nice easy work around - just set FN and LN (which seems to cause N to get set) and now those three cards sync properly.
Updated•3 years ago
|
Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/2e6bea815277
Ensure vCards have an N
property when sending to Google. r=aleca
Assignee | ||
Updated•3 years ago
|
Assignee | ||
Comment 8•3 years ago
|
||
Comment on attachment 9296283 [details]
Bug 1792101 - Ensure vCards have an N
property when sending to Google. r=#thunderbird-reviewers
[Approval Request Comment]
Regression caused by (bug #): probably never worked
User impact if declined: contacts fail to save to CardDAV server
Testing completed (on c-c, etc.): landed this week
Risk to taking this patch (and alternatives if risky): low
Comment 9•3 years ago
|
||
Comment on attachment 9296283 [details]
Bug 1792101 - Ensure vCards have an N
property when sending to Google. r=#thunderbird-reviewers
[Triage Comment]
Approved for beta
Comment 10•3 years ago
|
||
bugherder uplift |
Thunderbird 106.0b4:
https://hg.mozilla.org/releases/comm-beta/rev/38e8441a6035
Assignee | ||
Comment 11•3 years ago
|
||
Comment on attachment 9296283 [details]
Bug 1792101 - Ensure vCards have an N
property when sending to Google. r=#thunderbird-reviewers
[Approval Request Comment]
Regression caused by (bug #): probably never worked
User impact if declined: contacts fail to save to CardDAV server
Testing completed (on c-c, etc.): in beta 4
Risk to taking this patch (and alternatives if risky): low
Comment 12•3 years ago
|
||
Comment on attachment 9296283 [details]
Bug 1792101 - Ensure vCards have an N
property when sending to Google. r=#thunderbird-reviewers
[Triage Comment]
Approved for esr102
Comment 13•3 years ago
|
||
bugherder uplift |
Thunderbird 102.4.0:
https://hg.mozilla.org/releases/comm-esr102/rev/38d0d6cdfd89
Description
•