{"record":{"id":"47317a809f6a84db","repo":"hcengineering/platform","slug":"integration-not-found-json-stringify-integratio","errorCode":null,"errorMessage":"Integration not found: ${JSON.stringify(integrationKey)}","messagePattern":"Integration not found: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/integration-client/src/client.ts","lineNumber":205,"sourceCode":"        operation: 'connect',\n        error: error instanceof Error ? error.message : String(error),\n        socialId,\n        timestamp: Date.now()\n      }\n      this.emit('integration:error', errorData)\n      throw error\n    }\n  }\n\n  async updateConfig (\n    integrationKey: IntegrationKey,\n    config: Record<string, any>,\n    refresh?: () => Promise<void>\n  ): Promise<void> {\n    try {\n      const integration = await this.client.getIntegration(integrationKey)\n      if (integration == null) {\n        throw new Error(`Integration not found: ${JSON.stringify(integrationKey)}`)\n      }\n\n      const oldConfig = integration.data?.config\n      const data = {\n        ...integration.data,\n        config\n      }\n\n      await this.client.updateIntegration({\n        ...integration,\n        data\n      })\n      if (refresh != null) {\n        await refresh()\n      }\n\n      const eventData: IntegrationUpdatedData = {\n        integration,","sourceCodeStart":187,"sourceCodeEnd":223,"githubUrl":"https://github.com/hcengineering/platform/blob/63e28dc96483967b2fc21c881b3f1023c1de7718/packages/integration-client/src/client.ts#L187-L223","documentation":"updateConfig fetches the integration identified by integrationKey before merging the new config. If getIntegration returns null/undefined, there is no integration registered under that key, so the client throws with a JSON dump of the key. This prevents silently creating orphaned config updates.","triggerScenarios":"Calling integrationClient.updateConfig(integrationKey, config, refresh?) where the backend has no integration matching integrationKey.","commonSituations":"Typo in the integration key; integration removed or not yet registered on the server; using a key from a different workspace/environment (staging vs production).","solutions":["Verify the integrationKey string against the registered integrations (list them via the client or admin UI).","Check you are pointing the client at the correct workspace/environment where the integration exists.","Register or re-install the integration before calling updateConfig.","Fix casing/typo in the key — keys are exact-match strings."],"exampleFix":"// before\nawait client.updateConfig('slack-integraton', config)\n// after\nconst key = 'slack-integration'\nif (await client.getIntegration(key) != null) {\n  await client.updateConfig(key, config)\n}","handlingStrategy":"validation","validationCode":"const integration = await client.getIntegration(integrationKey)\nif (integration == null) throw new Error(`Cannot update config: integration ${integrationKey} is not registered`)","typeGuard":null,"tryCatchPattern":"try {\n  await client.updateConfig(integrationKey, config)\n} catch (err) {\n  if (err instanceof Error && err.message.includes('Integration not found')) {\n    // register the integration or correct the key\n  } else {\n    throw err\n  }\n}","preventionTips":["Keep integration keys in a single shared constants module, never inline strings.","Check integration existence with getIntegration before mutating it.","Distinguish per-environment keys (staging vs production) in config."],"tags":["integration","config","not-found"],"backgroundTag":"integration-not-found","analyzedSha":"63e28dc96483967b2fc21c881b3f1023c1de7718","analyzedAt":"2026-08-29T15:21:27.377Z","schemaVersion":2},"datasetVersion":"2026-08-29T17:17:51.833Z"}