QuisApp / flutter_contacts

MIT License
83 stars 138 forks source link

Platform Exception for Type Exchange accounts (IOS) #162

Open yassinsameh opened 3 months ago

yassinsameh commented 3 months ago

I only see this error being caused when updating a Contact that is using type Exchange on IOS.

PlatformException(unknown error, unknown error, Violated Constraints Error, null)

Is there a way for me to provide more info and debug this? Secondly is it normal to have multiple rawId's in accounts in IOS?

Sample Contact from Crashlytics Logs:

PlatformException(unknown error, unknown error, Violated Constraints Error, null), contact: {id: BE74522B-6766-4CBA-9293-5E3BE8EC88C9, displayName: Allen Martin kanoo, thumbnail: null, photo: null, isStarred: false, name: {first: A, last: M, middle: , prefix: , suffix: , nickname: , firstPhonetic: , lastPhonetic: , middlePhonetic: }, phones: [{number: +32495600000, normalizedNumber: +32495600000, label: work, customLabel: , isPrimary: false}], emails: [{address: a@domain.be, label: custom, customLabel: , isPrimary: false}, {address: a@domain.be, label: custom, customLabel: , isPrimary: false}, {address: a@domain.be, label: custom, customLabel: , isPrimary: false}, {address: a@domain.be, label: custom, customLabel: , isPrimary: false}], addresses: [], organizations: [], websites: [], socialMedias: [], events: [], notes: [], accounts: [{rawId: 43F85898-55F4-4061-BABD-3F65CA555A70, type: cardDAV, name: Address Book, mimetypes: []}, {rawId: 43F85898-55F4-4061-BABD-3F65CA555A70, type: cardDAV, name: Address Book, mimetypes: []}, {rawId: 58FDD79B-D96D-470C-9693-12B5B395EDAD, type: exchange, name: iPhone (contacts), mimetypes: []}, {rawId: 58FDD79B-D96D-470C-9693-12B5B395EDAD, type: exchange, name: iPhone (contacts), mimetypes: []}], groups: []}

@joachimvalente @joachim-quis

joachim-quis commented 1 month ago

Hi @yassinsameh

Secondly is it normal to have multiple rawId's in accounts in IOS?

Yes - multiple raw IDs just means that the unified contact is part of several CNContainers.

Is there a way for me to provide more info and debug this?

Hmm, I'm not sure how :( Were you able to debug any further since your original message?

yassinsameh commented 3 weeks ago

Hi @joachim-quis , Believe i found the pattern, It seems to always be a problem whenever a contact has 2 accounts of type "Exchange" and an Update contact operation occurs. Another example contact:

PlatformException(unknown error, unknown error, Violated Constraints Error, null), contact: {id: 53512965-5C43-423C-A3E7-14B5BD464429, displayName: Wale, thumbnail: null, photo: null, isStarred: false, name: {first: Wale, last: , middle: , prefix: , suffix: , nickname: , firstPhonetic: , lastPhonetic: , middlePhonetic: }, phones: [{number: +233244xxxxxx, normalizedNumber: +233244xxxxxx, label: mobile, customLabel: , isPrimary: false}], emails: [], addresses: [], organizations: [], websites: [], socialMedias: [{userName: xxxxx, label: facebook, customLabel: }], events: [], notes: [], accounts: [{rawId: 7DF19267-162E-4050-AA51-98E1DA54XXXX, type: exchange, name: Contacts, mimetypes: []}, {rawId: C274F6C7-2926-4915-88EE-ECA7C22FXXXX, type: exchange, name: Contacts, mimetypes: []}], groups: []}