Contacts icon indicating copy to clipboard operation
Contacts copied to clipboard

Custom labels get changed to all lowercase on import

Open johnnynoone opened this issue 1 year ago • 3 comments

Checklist

  • [X] I can reproduce the bug with the latest version given here.
  • [X] I made sure that there are no existing issues - open or closed - to which I could contribute my information.
  • [X] I made sure that there are no existing discussions - open or closed - to which I could contribute my information.
  • [X] I have read the FAQs inside the app (Menu -> About -> FAQs) and my problem isn't listed.
  • [X] I have taken the time to fill in all the required details. I understand that the bug report will be dismissed otherwise.
  • [X] This issue contains only one bug.
  • [X] I have read and understood the contribution guidelines.

Affected app version

1.1.0

Affected Android/Custom ROM version

GrapheneOS

Affected device model

Google Pixel 8

How did you install the app?

F-Droid / IzzyOnDroid

Steps to reproduce the bug

  1. Get a vcard that includes a custom label for a phone number. The custom label must have lower and upper case characters, for example Custom Label.
  2. Import the vcard.
  3. Notice that the custom label has become all lowercase, for example custom label.

Expected behavior

The custom label should be preserved verbatim. In the example, it would be Custom Label.

Actual behavior

The custom label is changed to all lowercase, for example custom label.

Screenshots/Screen recordings

No response

Additional information

My use case is exporting all my contacts from one phone and importing them on another phone, both using Fossify Contacts. I have verified that export is correct; the .vcf file contains the custom label as written in the app. Import is buggy as described above.

I have tested this both with my actual contact data and with a specially prepared test vcard. The test vcard is attached for your convenience (zipped to allow GitHub upload). It only contains one contact, with name set to "AAAAName AAAALastname".

test_vcard_AAAA.zip

johnnynoone avatar Jan 16 '25 02:01 johnnynoone

The logic starts here, but I can't find any obvious issues: https://github.com/FossifyOrg/Contacts/blob/master/app/src/main/kotlin/org/fossify/contacts/helpers/VcfImporter.kt#L59

johnnynoone avatar Jan 16 '25 03:01 johnnynoone

We rely for parsing on ez-vcard library and it returns the lowercased type. Probably that's a bug there, or it's done on purpose - in the vCard specification, type is always lowercased.

Aga-C avatar Jan 16 '25 08:01 Aga-C

For what it's worth, GrapheneOS stock contacts app imports those without lowercasing them.

johnnynoone avatar Jan 26 '25 00:01 johnnynoone