signalapp / Flock

Private contact and calendar sync for Android.
https://signal.org/blog/flock
357 stars 80 forks source link

Contact escaping issues on new imports from a CardDAV-Sync account #13

Closed jlund closed 10 years ago

jlund commented 10 years ago

For a given contact named "John Smith", the Flock version is "[[]] John Smith, [[]]", or sometimes "[] John Smith, []".

jlund commented 10 years ago

If CardDAV-Sync is disabled before the import, then most contacts are only escaped once (e.g. "[] John Smith, []"). This escaping affects both the CardDAV account and the Flock account in the "Contacts to display" section. If you Unregister your Flock account then the contacts go back to their unescaped forms in the CardDAV account.

The only thing I haven't tried yet is to delete my CardDAV account after Flock synchronization. I don't want us to lose the ability to replicate this bug on my edge case of a phone.

rhodey commented 10 years ago

I am able to reproduce this with a single contact from a google account I am importing. The strange thing about this bug is that the escape characters are not actually in the contact data, to verify this edit a contact with the weird escape character bug-- you should notice that the name displays in the edit page as normal.

For some reason it seems that the Android People app is displaying some Flock imported contacts strangely, or at least in difference to the source contact.

cyanfr commented 10 years ago

I have about 15 of these when importing from Google contacts. I notice that this happens (at least in my case) exclusively with prefixes and suffixes on the contact names.

That is, if the the text that ends up having [[]] around it is in the prefix position or the suffix position in Google Contacts, when it imports into flock it will have the brackets around it. The position will still be correct, just with brackets.

cyanfr commented 10 years ago

Also, if I try to fix the prefix or suffix entries, after next sync they come back with one set of brackets.

Example: Entry after initial Flock import: John Q Smith, [[MD]] Corrected manually to: John Q Smith, MD Flock syncs and entry changes to: John Q Smith, [MD]

In edit mode for the name this looks like: Prefix: First Name: John Middle Name: Q Last name: Smith Suffix: MD

If I take MD out of suffix and add it after Smith like "Smith MD" then the change sticks even after Flock sync.

Same for prefixes:

Example: Entry after initial Flock import: [[Mr]] John Q Smith Corrected manually to: Mr John Q Smith Flock syncs and entry changes to: [Mr] John Q Smith

So it seems like something with the way contact name prefixes and suffixes are stored.

rhodey commented 10 years ago

In order to correct any contacts with the weird escaping issue users can make a fake edit to each contact affected by this bug, for example to correct the contact [Dr] Nic...

  1. open the People / Contacts app
  2. find Dr Nic and tap Edit
  3. delete the "c" in Nic and then add it back
  4. save the contact

Alternatively users can delete and then re-import all contacts using the hidden "Delete all contacts" menu option, however depending on the number of contacts you have this could take a long time to sync because the SyncAdapters are still relatively slow :(