nextcloud / nextcloud/contacts

Contacts corrupts contact between import and export of same contact

Open
#1,850 23 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

0. Needs triage bug feature: import
Dominant language
JavaScript
Stars
642
Forks
220
Avg merge
14h 39m
Merged PRs (30d)
51

Description

Steps to reproduce
  1. create contact with multiple email addresses and/or ADR addresses
  2. export contact
  3. delete contact and refresh page, to be sure
  4. edit vcard according to https://tools.ietf.org/html/rfc6350
  5. import edited vcard
  6. export contact to new vcard file
    vcard file corrupted
Expected behaviour

vcard format according to RFC - PREF=1..100, not text. Whole meaning of PREF is lost as it is soaked up by text string.
Additionally, expect TYPE=Bogus to show in web UI as Bogus, but Bogus is lost somewhere, leaving the web UI with defaults.

Actual behaviour
EMAIL;PREF=1,TYPE=HOME:xxxxx@xxxxxxxxxxx.com
EMAIL;PREF=10,TYPE=OTHER:xxxxxxxxxxxx@xxxxx.com
EMAIL;PREF=15,TYPE=OTHER:xxxxxxx@xxxxxxxxxxxxxxxx.com
EMAIL;PREF=20,TYPE=OTHER:xxxxxxx@xxxxxxxxxxxxxxxx.info
TEL;PREF=1,TYPE=CELL:+61 ### ### ###
ADR;PREF=1,TYPE=HOME:;;xx xxxxxx xx;xxxxxxxxx;xxxxxxxxxxxxxxx;xxxx;Australi
 a
ADR;PREF=10,TYPE=OTHER:;;xxxxxxxxxxxxxxxxxxxxxxxx;xxxxxx;xxxxxxxxxxxxxxx;2
 034;Australia

converts to

EMAIL;PREF="1,TYPE=HOME":xxxxx@xxxxxxxxxxx.com
EMAIL;PREF="10,TYPE=OTHER":xxxxxxxxxxxx@xxxxx.com
EMAIL;PREF="15,TYPE=OTHER":xxxxxxx@xxxxxxxxxxxxxxxx.com
EMAIL;PREF="20,TYPE=OTHER":xxxxxxx@xxxxxxxxxxxxxxxx.info
TEL;PREF="1,TYPE=CELL";VALUE=UNKNOWN:+61 ### ### ###
ADR;PREF="1,TYPE=HOME":;;xxxxxxxxxxxx;xxxxxxxxx;xxxxxxxxxxxxxxx;xxxx;Austra
 lia
ADR;PREF="10,TYPE=OTHER":;;xxxxxxxxxxxxxxxxxxxxxxxx;xxxxxx;xxxxxxxxxxxxxxx;
 2034;Australia

Server configuration detail

Operating system: Linux 2.6.32-954.3.5.lve1.4.78.el6.x86_64 nextcloud/server#1 SMP Thu Mar 26 08:20:27 EDT 2020 x86_64

Webserver: LiteSpeed (litespeed)

Database: mysql 5.6.49

PHP version:

7.4.11
Modules loaded: Core, date, libxml, openssl, pcre, sqlite3, zlib, bz2, calendar, ctype, curl, hash, filter, ftp, gettext, gmp, SPL, iconv, pcntl, readline, Reflection, session, standard, shmop, SimpleXML, mbstring, tokenizer, xml, litespeed, bcmath, dom, fileinfo, gd, imagick, imap, intl, json, exif, mysqli, mysqlnd, PDO, pdo_mysql, pdo_sqlite, Phar, posix, soap, sockets, timezonedb, xmlreader, xmlrpc, xmlwriter, xsl, zip, Zend OPcache

Nextcloud version: 20.0.0 - 20.0.0.9

Updated from an older Nextcloud/ownCloud or fresh install: updated

Where did you install Nextcloud from: unknown

Signing status

Array
(
)

List of activated apps
Enabled:
 - accessibility: 1.6.0
 - activity: 2.13.1
 - admin_audit: 1.10.0
 - apporder: 0.11.0
 - bookmarks: 3.4.3
 - calendar: 2.1.2
 - camerarawpreviews: 0.7.8
 - cloud_federation_api: 1.3.0
 - comments: 1.10.0
 - contacts: 3.4.0
 - contactsinteraction: 1.1.0
 - dashboard: 7.0.0
 - dav: 1.16.0
 - extract: 1.2.4
 - federatedfilesharing: 1.10.1
 - files: 1.15.0
 - files_markdown: 2.3.1
 - files_pdfviewer: 2.0.1
 - files_rightclick: 0.17.0
 - files_sharing: 1.12.0
 - files_videoplayer: 1.9.0
 - firstrunwizard: 2.9.0
 - issuetemplate: 0.7.0
 - keeweb: 0.6.3
 - logreader: 2.5.0
 - lookup_server_connector: 1.8.0
 - notes: 4.0.0
 - notifications: 2.8.0
 - oauth2: 1.8.0
 - password_policy: 1.10.1
 - photos: 1.2.0
 - privacy: 1.4.0
 - provisioning_api: 1.10.0
 - recommendations: 0.8.0
 - serverinfo: 1.10.0
 - settings: 1.2.0
 - sharebymail: 1.10.0
 - support: 1.3.0
 - survey_client: 1.8.0
 - systemtags: 1.10.0
 - tasks: 0.13.4
 - text: 3.1.0
 - theming: 1.11.0
 - twofactor_backupcodes: 1.9.0
 - updatenotification: 1.10.0
 - user_status: 1.0.0
 - viewer: 1.4.0
 - weather_status: 1.0.0
 - workflowengine: 2.2.0
Disabled:
 - encryption
 - federation
 - files_external
 - files_trashbin
 - files_versions
 - nextcloud_announcements
 - user_ldap

Configuration (config/config.php)
{
    "installed": true,
    "dbtype": "mysql",
    "dbname": "***REMOVED SENSITIVE VALUE***",
    "dbuser": "***REMOVED SENSITIVE VALUE***",
    "dbpassword": "***REMOVED SENSITIVE VALUE***",
    "dbhost": "***REMOVED SENSITIVE VALUE***",
    "dbtableprefix": "oc_",
    "forcessl": false,
    "theme": "",
    "3rdpartyroot": "",
    "3rdpartyurl": "",
    "blacklisted_files": [
        ".htaccess"
    ],
    "default_language": "en",
    "default_locale": "en_AU",
    "overwritehost": "",
    "overwriteprotocol": "https",
    "overwritewebroot": "",
    "overwritecondaddr": "",
    "overwrite.cli.url": "https:\/\/cloud.remotely-helpful.com\/",
    "htaccess.RewriteBase": "\/",
    "defaultapp": "dashboard",
    "knowledgebaseenabled": true,
    "knowledgebaseurl": "http:\/\/api.apps.nextcloud.com\/v1",
    "appstoreenabled": true,
    "appstoreurl": "https:\/\/apps.nextcloud.com\/api\/v1",
    "apps_paths": [
        {
            "path": "\/home\/remotely\/www\/cloud\/apps",
            "url": "\/apps",
            "writable": true
        }
    ],
    "mail_smtpdebug": false,
    "mail_smtpmode": "smtp",
    "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
    "mail_smtpport": "587",
    "mail_smtptimeout": 10,
    "mail_smtpauthtype": "LOGIN",
    "appcodechecker": true,
    "log_type": "nextcloud",
    "logfile": "\/home\/remotely\/cloud\/logs\/nextcloud.log",
    "loglevel": 2,
    "logdateformat": "F d, Y H:i:s",
    "logtimezone": "Australia\/Sydney",
    "log_rotate_size": 104857600,
    "passwordsalt": "***REMOVED SENSITIVE VALUE***",
    "hashingCost": 10,
    "trashbin_retention_obligation": "180, auto",
    "allow_user_to_change_display_name": true,
    "xframe_restriction": true,
    "custom_csp_policy": "default-src 'self'; script-src 'self' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; frame-src *; img-src *; font-src 'self' data:; media-src *",
    "customclient_desktop": "",
    "customclient_android": "",
    "customclient_ios": "",
    "remember_login_cookie_lifetime": 1296000,
    "session_keepalive": true,
    "updatechecker": true,
    "updater.server.url": "https:\/\/updates.nextcloud.com\/updater_server\/",
    "updater.release.channel": "stable",
    "has_internet_connection": true,
    "writable_appsdir": true,
    "datadirectory": "***REMOVED SENSITIVE VALUE***",
    "version": "20.0.0.9",
    "maxZipInputSize": "838860800",
    "allowZipDownload": true,
    "instanceid": "***REMOVED SENSITIVE VALUE***",
    "maintenance": false,
    "trusted_domains": [
        "cloud.remotely-helpful.info",
        "cloud.remotely-helpful.com",
        "remotely-helpful.info",
        "remotely-helpful.com",
        "remotelyhelpful.info",
        "remotelyhelpful.com",
        "remotelyhelpful.info.au",
        "remotelyhelpful.com.au",
        "remotely-helpful.info.au",
        "remotely-helpful.com.au",
        "vmres08.auserver.com.au"
    ],
    "secret": "***REMOVED SENSITIVE VALUE***",
    "mail_from_address": "***REMOVED SENSITIVE VALUE***",
    "mail_domain": "***REMOVED SENSITIVE VALUE***",
    "appstore.experimental.enabled": true,
    "mail_smtpauth": 1,
    "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
    "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
    "app_install_overwrite": [
        "keeweb",
        "apporder",
        "calendar",
        "contacts",
        "external",
        "camerarawpreviews",
        "tasks",
        "bookmarks",
        "occweb",
        "extract"
    ],
    "mysql.utf8mb4": false,
    "enabledPreviewProviders": [
        "OC\\Preview\\PNG",
        "OC\\Preview\\JPEG",
        "OC\\Preview\\GIF",
        "OC\\Preview\\HEIC",
        "OC\\Preview\\BMP",
        "OC\\Preview\\XBitmap",
        "OC\\Preview\\MP3",
        "OC\\Preview\\TXT",
        "OC\\Preview\\MarkDown",
        "OC\\Preview\\OpenDocument",
        "OC\\Preview\\Krita"
    ],
    "tempdirectory": "\/home\/remotely\/tmp\/NextCloud"
}

Are you using external storage, if yes which one: local/smb/sftp/...

Are you using encryption:

Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/...

Client configuration

Browser: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.75 Safari/537.36

Operating system:

Logs

Web server error log
Insert your web server log here 
Nextcloud log
Insert your Nextcloud log here
Browser log

Insert your browser log here, this could for example include:

a) The javascript console log
b) The network log
c) ...

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No source file or test is named in the issue. Reproduce the listed contact import/export sequence with multiple EMAIL, TEL, and ADR properties, then trace the import and export entry points; done means RFC-compliant PREF and TYPE values survive the round trip and custom TYPE values remain visible in the web UI.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.