Batch update does not create a new account if a contact was ever in the history of another contact
I am creating a script that updates HubSpot. Our DB is the source of truth. I'm encountering a problem where HS will update an account even when I update by email on an email that is no longer associated with an account, but exists somewhere in the history of it.
As an example, we may have a client that has an account on HubSpot and they have a primary email on the account. Then, the person who owns that email leaves their company and a new email is listed associated with the account. In that case, the primary email is set to the new contact.
When I search contacts the old email will give zero results. It also allows me to use the GUI to create a new account under the old email. However, when my script does a batch create/update with the old email, it still updates the account they no longer belong to. When I make a get request for the VID, HubSpot sends the VID of the old account and now when my script runs it will ping pong between updating the properties from the old account to the new one because they both have the same VID. So on one run it sets the email value to the old email and on the next it sets the email value to the correct one and every 5 - 10 minutes the primary email on the account will switch.
After discovering this issue, I turned off updating the email property for an account if we already have the VID, but it only helps with that one property.
For every account that has ever been associated in the history of the email property of a contact, they are still getting the VID of the previous contact and updating it. So, unfortunately, it causes a lot of problems on our end because we can't trust HubSpot's API to only give us the VID of a contact if the email is the PRIMARY email on the account and to create new contacts if an email exists in the history of a previous contact.
Does HS have any plans to fix this bug or has anyone found an efficient work-around to deal with this? It's creating a log of issues for us.
I hope I've explained the issue clearly. Please let me know if I can elaborate.