{"record":{"id":"25f0fad70e209571","repo":"gitroomhq/postiz-app","slug":"invalid-integration","errorCode":null,"errorMessage":"Invalid integration","messagePattern":"Invalid integration","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"apps/backend/src/api/routes/integrations.controller.ts","lineNumber":152,"sourceCode":"  ) {\n    if (typeof body !== 'string') {\n      throw new Error('Invalid body');\n    }\n\n    await this._integrationService.updateProviderSettings(org.id, id, body);\n  }\n  @Post('/:id/nickname')\n  async setNickname(\n    @GetOrgFromRequest() org: Organization,\n    @Param('id') id: string,\n    @Body() body: { name: string; picture: string }\n  ) {\n    const integration = await this._integrationService.getIntegrationById(\n      org.id,\n      id\n    );\n    if (!integration) {\n      throw new Error('Invalid integration');\n    }\n\n    const manager = this._integrationManager.getSocialIntegration(\n      integration.providerIdentifier\n    );\n    if (!manager.changeProfilePicture && !manager.changeNickname) {\n      throw new Error('Invalid integration');\n    }\n\n    const { url } = manager.changeProfilePicture\n      ? await manager.changeProfilePicture(\n          integration.internalId,\n          integration.token,\n          body.picture\n        )\n      : { url: '' };\n\n    const { name } = manager.changeNickname","sourceCodeStart":134,"sourceCodeEnd":170,"githubUrl":"https://github.com/gitroomhq/postiz-app/blob/0f1647f7491a217d43eb5ae7a480484bdf0aff3e/apps/backend/src/api/routes/integrations.controller.ts#L134-L170","documentation":"After resolving the integration, the controller fetches its provider implementation and requires it to expose changeProfilePicture or changeNickname. If the provider implements neither capability, Error('Invalid integration') is thrown — the channel type simply does not support identity changes.","triggerScenarios":"Calling the nickname/bot-picture endpoint on a channel whose provider class has no changeProfilePicture and no changeNickname methods (e.g. read-only or constrained providers).","commonSituations":"Generic UI showing the 'change bot identity' action for every connected channel even when the provider lacks support; new custom provider implemented without the optional methods.","solutions":["Check provider capabilities before showing the action in the UI (feature-detect changeProfilePicture/changeNickname)","Skip the operation for providers that do not implement it","If you own the provider, implement changeNickname (and optionally changeProfilePicture)"],"exampleFix":"// before\nif (!manager.changeProfilePicture && !manager.changeNickname) {\n  throw new Error('Invalid integration');\n}\n// after\nconst canChange = Boolean(manager.changeProfilePicture || manager.changeNickname);\nif (!canChange) {\n  throw new HttpException('Provider does not support identity changes', HttpStatus.BAD_REQUEST);\n}","handlingStrategy":"type-guard","validationCode":"const caps = getProviderCapabilities(integration.providerIdentifier);\nif (!caps.changeNickname && !caps.changeProfilePicture) hideIdentityActions();","typeGuard":"const supportsIdentityChange = (p: Provider) => Boolean(p.changeNickname || p.changeProfilePicture);","tryCatchPattern":"try { await updateBotPicture(id); } catch (e) { if (e.message === 'Invalid integration') showUnsupportedNotice(); else throw e; }","preventionTips":["Feature-detect optional provider methods before rendering actions","Maintain a capability map per provider in the frontend"],"tags":["integrations","provider-capability","feature-detection"],"backgroundTag":"provider-not-allowed","analyzedSha":"0f1647f7491a217d43eb5ae7a480484bdf0aff3e","analyzedAt":"2026-08-27T12:09:55.020Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}