"Company already exists" error when calling `companies.createOrUpdate`
My code:
const intercom = new IntercomClient({
environment: IntercomEnvironment.AuProduction,
token: 'MY_TOKEN_HERE',
version: '2.11',
});
const company: Company = await intercom.companies.createOrUpdate({
company_id: user.businessID,
name: user.businessName,
remote_created_at: dateCreated,
custom_attributes: {
'something_here': 'a_value',
},
});
It usually works. But sometimes, I somehow got this error on production:
{
"type": "error.list",
"request_id": "00095et5a4vo8m2t8kbg",
"errors": [
{
"code": "unique_company_constraint",
"message": "Company already exists."
}
]
}
This shouldn't be possible when calling the API, the REST method is not doing what it says it should be doing.
Thanks for the issue @jpike88!
It usually works.
This sounds like an issue related to the Intercom server - we'll follow-up with the Intercom team to see if this is a known issue or not. In the meantime, could you give any more information here? What sort of behavior have you noticed in particular? Any additional information with respect to your call pattern could help diagnose the issue further.
it appears to not happen all the time. beyond that I have no more info to add
Hi @jpike88 - sorry for any inconvenience here. This looks to be an error that was created to handle a race condition when a company is being updated but I agree that it doesn't make sense. I have raised a ticket around this issue and will provide an update when it's addressed.
Any news? It's been 3 weeks now
We are still getting this error... is there any news on this?
It's now been two months. Things are getting ridiculous now, considering the premium rate we pay for this product.
@Eclairemoy We are still having this issue, do you have any status update on this? it's been open for quite a while now
@iainbreen can we have an update on this? It's been SIX MONTHS since I opened this ticket. We pay a solid sum to Intercom. All I expect is a working product.
closing cause I don't care anymore, i'll just ignore the error and move on. incredible.