intercom-node icon indicating copy to clipboard operation
intercom-node copied to clipboard

"Company already exists" error when calling `companies.createOrUpdate`

Open jpike88 opened this issue 11 months ago • 8 comments

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.

jpike88 avatar Jan 10 '25 05:01 jpike88

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.

fern-support avatar Jan 12 '25 14:01 fern-support

it appears to not happen all the time. beyond that I have no more info to add

jpike88 avatar Jan 12 '25 15:01 jpike88

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.

Eclairemoy avatar Jan 16 '25 11:01 Eclairemoy

Any news? It's been 3 weeks now

jpike88 avatar Feb 07 '25 05:02 jpike88

We are still getting this error... is there any news on this?

jpike88 avatar Feb 17 '25 04:02 jpike88

It's now been two months. Things are getting ridiculous now, considering the premium rate we pay for this product.

jpike88 avatar Mar 18 '25 12:03 jpike88

@Eclairemoy We are still having this issue, do you have any status update on this? it's been open for quite a while now

AlbertoMontalesi avatar May 29 '25 07:05 AlbertoMontalesi

@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.

jpike88 avatar Jun 20 '25 03:06 jpike88

closing cause I don't care anymore, i'll just ignore the error and move on. incredible.

jpike88 avatar Nov 27 '25 05:11 jpike88