Skip to content

Fix duplicated MIME types

This patch fixes a long-standing issue with creating contact folders in an address book (at least https://bugs.kde.org/show_bug.cgi?id=443839, https://bugs.kde.org/show_bug.cgi?id=387804 and https://bugs.kde.org/show_bug.cgi?id=385510)

I discovered a message in the akonadiconsole:

<- kontact-3079350838 (0x55913100c9f0) {
    "attributes": {
    },
    "cachePolicy": {
        "cacheTimeout": -1,
        "checkInterval": -1,
        "inherit": true,
        "localParts": [
        ],
        "syncOnDemand": false
    },
    "displayPref": "Undefined",
    "enabled": true,
    "indexPref": "Undefined",
    "isVirtual": false,
    "mimeTypes": [
        "application/x-vnd.kde.contactgroup",
        "text/directory",
        "application/x-vnd.kde.contactgroup"
    ],
    "name": "testfolder",
    "parent": {
        "type": "UID",
        "value": "290"
    },
    "remoteId": "",
    "remoteRevision": "",
    "response": false,
    "syncPref": "Undefined",
    "tag": 170,
    "type": "CreateCollection"
}

-> kontact-3079350838 (0x55913100c9f0) {
    "error": {
        "code": 1,
        "message": "Could not create collection testfolder, resourceId 53"
    },
    "response": true,
    "tag": 170,
    "type": "CreateCollection"
}

You can the see duplicated entries in the mimeTypes array. These entries cause a UNIQUE constraint SQL error when Akonadi tries to store associated MIME types in the CollectionMimeTypeRelation table.

Edited by Andrii Pravorskyi

Merge request reports