Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Contacts import: Contacts treated as duplicates despite differences in some fields #9592

Open
2 tasks done
respiranto opened this issue Aug 17, 2024 · 10 comments
Open
2 tasks done

Comments

@respiranto
Copy link
Contributor

Prerequisites

  • I have searched for duplicate or closed issues
  • I can recreate the issue with all plugins disabled

Describe the issue

When importing contacts from a vCard file that contains two vcard objects with the same e-mail address, or one vcard object with an e-mail address that is already assigned to an existing contact, the contacts are treated as duplicates and one of them is not imported, with the message "Skipped 1 existing entries: [...]".

This does not happen if "Replace the entire address book" is activated on importing.

I would expect that a contact is only skipped on import if it would be an exact duplicate of another contact.

Further, I would expect that duplicates within a file are treated the same regardless of whether "Replace the entire address book" is activated on importing.

Example (note that vCard mandates CRLF as newline sequence):

BEGIN:VCARD
VERSION:3.0
N:Doe;Jane;;;
FN:Jane Doe
EMAIL:doe@example.net
END:VCARD
BEGIN:VCARD
VERSION:3.0
N:Doe;John;;;
FN:John Doe
EMAIL:doe@example.net
END:VCARD

Result of importing above example:

  • "Successfully imported 1 contacts: Jane Doe"
  • "Skipped 1 existing contacts: John Doe"
  • Only the record for "Jane Doe" is imported.

Originally reported at the Debian BTS as Bug 1078776, where I was asked to report the bug here instead.

What browser(s) are you seeing the problem on?

Firefox

What version of PHP are you using?

v8.2

What version of Roundcube are you using?

master / 58721e3

JavaScript errors

No response

PHP errors

No response

@pabzm
Copy link
Member

pabzm commented Sep 12, 2024

Fixed via #9606

@pabzm pabzm closed this as completed Sep 12, 2024
@respiranto
Copy link
Contributor Author

IMHO, #9606 does not fully solve this issue.

As written initially, I would expect only exact duplicates to be skipped (i.e.: same fields set, all fields equal).

@pabzm
Copy link
Member

pabzm commented Sep 15, 2024

It solved the topic from the title of this issue, which I found to be a good step forward.

If you insist on your position please re-open and change the title or create a new issue.

@respiranto respiranto changed the title Contacts import: Contacts with matching e-mail address treated as duplicates Contacts import: Contacts treated as duplicates despite differences in some fields Sep 16, 2024
@respiranto
Copy link
Contributor Author

Title changed.

I seem not to be allowed to re-open the issue.

@pabzm pabzm reopened this Sep 17, 2024
@pabzm
Copy link
Member

pabzm commented Sep 17, 2024

One problem I see with importing cards despite identical name and email address is, that in the list of contacts we show those two: name and email address. So in that list the two contacts would not be distinguishable.

@respiranto
Copy link
Contributor Author

I see the following options to handle this problem (two different objects with matching name and e-mail address(es)):

  • (a) Fail on importing the second object, with an explanatory error message.
  • (b) Provide a warning message.
  • (c) Merge the two objects somehow.

I think I prefer (b).

@pabzm
Copy link
Member

pabzm commented Sep 18, 2024

To clarify: in (b) you would still import the almost-duplicate contact?

@respiranto
Copy link
Contributor Author

To clarify: in (b) you would still import the almost-duplicate contact?

Yes.

@pabzm
Copy link
Member

pabzm commented Sep 19, 2024

I would be fine with that and merge such a PR but won't do it myself in the foreseeable future.

@alecpl What do you think?

@alecpl
Copy link
Member

alecpl commented Sep 22, 2024

The way it is implemented a contact is considered existing if another contact with same name OR email address exists. One could argue that should be "AND" not "OR".

Another story is what to do when a duplicate is found on import. One could argue that we need an option to choose from, as it could be: 1) skip, 2) replace, 3) merge (whatever that would mean), 4) add. A separate thing is informing the user what has been done.

That being said, I think current state is fine, but I would accept a pull request that implements such behavior selector(s) in the import dialog.

Also, you could argue that for duplicates in the import file itself you might want a separate solution, e.g. by checking for duplicates in it before attempting to import anything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants