def temba_compare_contacts(first, second):
    """
    Compares two Temba contacts to determine if there are differences.
    These two contacts are presumably referencing the same contact,
    but we need to see if there are any differences between them.

    Returns name of first difference found, one of 'name' or 'urns' or
    'groups' or 'fields', or None if no differences were spotted.
    """
    if first.uuid != second.uuid:  # pragma: no cover
        raise ValueError("Can't compare contacts with different UUIDs")

    if first.name != second.name:
        return 'name'

    if sorted(first.urns) != sorted(second.urns):
        return 'urns'

    if sorted(first.groups) != sorted(second.groups):
        return 'groups'

    if first.fields != second.fields:
        return 'fields'

    return None