Skip to content

Return full Android contact records for phone/email lookups#823

Draft
Copilot wants to merge 5 commits into
masterfrom
copilot/fix-getcontacts-missing-data
Draft

Return full Android contact records for phone/email lookups#823
Copilot wants to merge 5 commits into
masterfrom
copilot/fix-getcontacts-missing-data

Conversation

Copilot AI commented May 28, 2026

Copy link
Copy Markdown

Android getContactsByPhoneNumber() and getContactsByEmailAddress() were returning only the matched Data rows, so fields from other MIME types on the same contact were omitted. This change makes those lookups rehydrate the full contact record, aligning Android behavior with iOS.

  • Lookup behavior

    • Resolve matching CONTACT_IDs from the initial phone/email query
    • Re-query ContactsContract.Data for those contact IDs
    • Build responses from the full aggregated contact rows instead of the matched subset
  • Returned data

    • Phone lookups now include all phone numbers, email addresses, postal addresses, company/job fields, and other contact data for the matched contact
    • Email lookups now do the same, instead of returning only email rows
  • Query handling

    • Preserve result ordering from the initial match set
    • Batch CONTACT_ID rehydration queries to avoid oversized IN (...) clauses
    • Make cursor iteration null-safe in the new helper path
public WritableArray getContactsByEmailAddress(String emailAddress) {
    return getFullContactsForSelection(
            ContactsContract.CommonDataKinds.Email.ADDRESS + " LIKE ?",
            new String[] { "%" + emailAddress + "%" });
}

Copilot AI changed the title [WIP] Fix getContactsByPhoneNumber and getContactsByEmailAddress data retrieval Return full Android contact records for phone/email lookups May 28, 2026
Copilot AI requested a review from morenoh149 May 28, 2026 02:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

getContactsByPhoneNumber() & getContactsByEmailAddress() doesn't provide whole contact data in Android

2 participants