Unfortunately, I can’t reproduce the problem. Adding the CATEGORIES creates the group as expected (Samsung Note 10.1 with Android 4.4).
Let’s have a look at the logs, too:
2016-11-25 14:22:21 1 [syncadapter.ContactsSyncManager] Creating local contact
PARAMETER #1 = Contact(uid=c247af59-c850-495f-9ce9-6de273807d95, displayName=John Doe, givenName=John, familyName=Doe)
2016-11-25 14:22:21 1 [vcard4android.AndroidContact] Built StructuredName data row
PARAMETER #1 = mType: 1, mUri: content://com.android.contacts/data?account_name=test%40citrin.ru&account_type=bitfire.at.davdroid&caller_is_syncadapter=true, mSelection: null, mExpectedCount: null, mYieldAllowed: false, mValues: data9=null data5=null data8=null data1=John Doe data6=null data2=John data4=null data3=Doe data7=null mimetype=vnd.android.cursor.item/name, mValuesBackReferences: null, mSelectionArgsBackReferences: null
2016-11-25 14:22:21 1 [vcard4android.BatchOperation] Committing 2 operations …
2016-11-25 14:22:21 1 [vcard4android.BatchOperation] Running operations 0 to 1
2016-11-25 14:22:21 1 [vcard4android.BatchOperation] … 2 record(s) affected
2016-11-25 14:22:21 1 [vcard4android.BatchOperation] Committing 3 operations …
2016-11-25 14:22:21 1 [vcard4android.BatchOperation] Running operations 0 to 2
2016-11-25 14:22:22 1 [vcard4android.BatchOperation] … 2 record(s) affected
The last 3 lines:
2016-11-25 14:22:21 1 [vcard4android.BatchOperation] Committing 3 operations …
2016-11-25 14:22:21 1 [vcard4android.BatchOperation] Running operations 0 to 2
2016-11-25 14:22:22 1 [vcard4android.BatchOperation] … 2 record(s) affected
are generated by ContactsSyncManager::processVCard
and are for group management (I have made the logs more verbose now). The first operations deletes the group assignments for this contact, and then there are twice as many operations as groups. In our case, there are 2 operations, which means that one group has been assigned.
This is what is expected and what I see in my own debug logs when I try to reproduce the problem, too.
Are you absolutely sure that the group is not created on your device? What happens if you change this contact and synchronize it again – is CATEGORIES
set correctly?
Also, from which version did you upgrade? Contact group management hasn’t changed in the last versions – maybe you have updated from a very old version?