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

Include better error reporting on contact import #655

Open
0xE0-rng opened this issue Jan 17, 2019 · 0 comments
Open

Include better error reporting on contact import #655

0xE0-rng opened this issue Jan 17, 2019 · 0 comments

Comments

@0xE0-rng
Copy link

0xE0-rng commented Jan 17, 2019

The current import works well, but for the cases when it fails it does not report any errors as the error does not get set properly.
It would be nice to have some the contact it fails on printed out (even to the console would be helpful)

let vData = ICAL.stringify(contact.vCard.jCal)
// push contact to server and use limit
requests.push(limit(() => contact.addressbook.dav.createVCard(vData)
    .then((response) => {
        // setting the contact dav property
        Vue.set(contact, 'dav', response)

        // success, update store
        context.commit('addContact', contact)
        context.commit('addContactToAddressbook', contact)
        context.commit('extractGroupsFromContacts', [contact])
        context.commit('incrementAccepted')
    })
    .catch((error) => {
        // error is not set properly
        context.commit('incrementDenied')
        console.error(error)
    })
))

Steps to reproduce

  1. Open Import
  2. select contacts with maleformed content
  3. no error

Problems that I happens with importing contacts that contain special characters like emojis, contacts that do not contain characters as names, contatct that dont have a name set

The following contacts are example contacts that will produce an error

BEGIN:VCARD
VERSION:3.0
FN:Peter 🇨🇵
N:🇨?;Peter;;;
TEL;TYPE=CELL:+123123123
BDAY;VALUE=DATE:19960101
UID:36426aa9-7290-4e06-af17-ac50655cf7f0
END:VCARD
BEGIN:VCARD
VERSION:3.0
TEL;TYPE=CELL:+123123123
ITEM1.ORG:AEM (jm)
ITEM1.X-ABLABEL:
UID:0cff052e-a800-4719-9df3-203e0a608602
END:VCARD
BEGIN:VCARD
VERSION:3.0
TEL;TYPE=CELL:+123123123
UID:e9f1a5d3-871b-4cf1-8874-6d2edce24d9d
END:VCARD

Expected behaviour

A error message is shown that includes the contact the import had problems with.

Actual behaviour

Non informational errors like the following are reported

Error
    at XMLHttpRequest.s.onreadystatechange (http://192.168.178.35/apps/contacts/js/contacts.js?v=0694d79e-0:7:213118)

Server configuration

Operating system: FreeNas

Web server: nginx

Database: mysql Version: 5.6.42

PHP version: 7.1.25

ownCloud version: 15.0.0

Contacts version: 1.6.4

Updated from an older ownCloud or fresh install: fresh install from freeNas plugin

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

1 participant