Bug: Contact messed up in address book after editing (Error v.replace is not a function)
Status: UNCONFIRMED
Priority: --
Created: 2022-10-26 09:41:37+00:00
Resolved: 2022-10-26 10:43:49+00:00

Steps to reproduce:

I run a synchronized address book (google, CardDAV URL) with 307 entries.
I edited a contact by switching a phone number from "private" to "fax (business)". I then clicked save.


Actual results:

The edited entry was stored completely empty. All contact data was lost immediately.

I found the following related error in console:

Error creating vCard properties TypeError: v.replace is not a function
    value resource:///modules/VCardUtils.jsm:675
    fromVCard resource:///modules/VCardUtils.jsm:675
    AddrBookCard resource:///modules/AddrBookCard.jsm:44
    get resource://gre/modules/XPCOMUtils.jsm:62
    get vCardProperties resource:///modules/AddrBookCard.jsm:184
    _getText chrome://messenger/content/addressbook/abView-new.js:457
    getText chrome://messenger/content/addressbook/abView-new.js:539
    getCellText chrome://messenger/content/jsTreeView.js:44
    set index chrome://messenger/content/addressbook/aboutAddressBook.js:1272
    _addRowAtIndex chrome://messenger/content/tree-listbox.js:1450
    _ensureVisibleRowsAreDisplayed chrome://messenger/content/tree-listbox.js:1344
    invalidate chrome://messenger/content/tree-listbox.js:1285
    sortBy chrome://messenger/content/addressbook/abView-new.js:140
    observe chrome://messenger/content/addressbook/abView-new.js:381
    modifyCard resource:///modules/AddrBookDirectory.jsm:576
    modifyCard resource:///modules/CardDAVDirectory.jsm:125
    saveCurrentContact chrome://messenger/content/addressbook/aboutAddressBook.js:3456
    validateBeforeSaving chrome://messenger/content/addressbook/aboutAddressBook.js:3331
    init chrome://messenger/content/addressbook/aboutAddressBook.js:2489
AddrBookCard.jsm:50:15
    AddrBookCard resource:///modules/AddrBookCard.jsm:50
    get resource://gre/modules/XPCOMUtils.jsm:62
    get vCardProperties resource:///modules/AddrBookCard.jsm:184
    _getText chrome://messenger/content/addressbook/abView-new.js:457
    getText chrome://messenger/content/addressbook/abView-new.js:539
    getCellText chrome://messenger/content/jsTreeView.js:44
    set index chrome://messenger/content/addressbook/aboutAddressBook.js:1272
    _addRowAtIndex chrome://messenger/content/tree-listbox.js:1450
    _ensureVisibleRowsAreDisplayed chrome://messenger/content/tree-listbox.js:1344
    invalidate chrome://messenger/content/tree-listbox.js:1285
    sortBy chrome://messenger/content/addressbook/abView-new.js:140
    observe chrome://messenger/content/addressbook/abView-new.js:381
    modifyCard resource:///modules/AddrBookDirectory.jsm:576
    modifyCard resource:///modules/CardDAVDirectory.jsm:125
    saveCurrentContact chrome://messenger/content/addressbook/aboutAddressBook.js:3456
    validateBeforeSaving chrome://messenger/content/addressbook/aboutAddressBook.js:3331
    init chrome://messenger/content/addressbook/aboutAddressBook.js:2489


Followed by 
[Exception... "Sending card to the server failed, response was 503 Service Unavailable"  nsresult: "0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame :: resource:///modules/CardDAVDirectory.jsm :: _sendCardToServer :: line 420"  data: no] CardDAVDirectory.jsm:420:24
    _sendCardToServer resource:///modules/CardDAVDirectory.jsm:420
    AsyncFunctionNext self-hosted:632

The error "v.replace is not a function" repeated several times then, maybe caused by my wondering attempts to check.


Expected results:

I expected the entry to simply update. And later on, synchronize.