--- On Tue, 1/12/10, Arjun Nair <[email protected]> wrote:
> I am going through XX-7304 [1] and I
> noticed that when we import contacts from Gmail, we add it
> to the database (phonebook_file_entry table) without
> checking for duplicate entries. This means that if you
> import your contacts from an account multiple times, it will
> create multiple duplicate entries of the same set of
> contacts in your database.
I think this is valid for all types of import - csv imports as well. However,
the contacts are displayed only one time in the phonebook (they'll have the
same id in returned phonebook entries map).
>
> Gmail assigns an unique resource id to each contact entry
> resource (ContactEntry.getId). At the minimum, we should
> store this id in the table, and use it to determine whether
> to add a particular entry to the table or update an existing
> entry. Ideally, we should store the versionId
> (ContactEntry.getVersionId) as well, and update existing
> entries only when the versionId has changed.
Looks good - though it will introduce some overhead by performing the
validation for each potential contact. Another option would be to mark all the
contacts imported from a specific gmail account (so we'll know from where they
were imported). On a 2nd import attempt we can delete all the contacts linked
with the account and safely proceed with the new import.
George
_______________________________________________
sipx-dev mailing list [email protected]
List Archive: http://list.sipfoundry.org/archive/sipx-dev
Unsubscribe: http://list.sipfoundry.org/mailman/listinfo/sipx-dev
sipXecs IP PBX -- http://www.sipfoundry.org/