Duplicate emails?

Your software
My Mautic version is: 4.2
My PHP version is: 7.4.28
My Database type and version is: 10.4.26-MariaDB-log

I am noticing that i have records in the Mautic DB that have duplicate emails. We are feeding data to mautic via a one-way sync from SFDC using the Mautic plugin. If i have email field set to unique identifier (which i do), how is it even possible that Mautic will allow the creation of a new record instead of upserting it?

What can i do to prevent this?

These errors are showing in the log:

Steps I have tried to fix the problem:

Hi,

Mautic core api should merge contacts automatically, but in case it does not, you have deduplicate command available that should merge records.

It would be good however if you can find the root cause of the issue, since mautic api should merge the contacts in case one contact already exists with that email.

About the unique constraint: due the nature of the software we cannot add unique constraint on database since, that is why you are able to add more then one contact with the same email (and why database is not triggering the error).

thanks for the reply. I’m still a bit confused on the purpose of a unique identifier field if it isn’t actually unique.

Any suggestions on troubleshooting this?

I think its best to imagine unique identifier here as application level setting based on which the software treats the contact.

I do not know all the specifics but I would say that the de-duplication logic relies heavily on this setting, as well as, some other components.

In that sense when you mark something as unique - its unique, but its unique from the perspective of application logic (which tries its best to make it unique from the data - database perspective).

How to troubleshoot?

  1. I would first ensure that the field really always has the same value.
  2. I would set debug flag in mautic and try to create a trace and investigate the logic behind merging.