{"record":{"id":"f042977e3a6c01c5","repo":"yikart/AiToEarn","slug":"channelwebhooknotsupported","errorCode":"ChannelWebhookNotSupported","errorMessage":"ChannelWebhookNotSupported","messagePattern":"ChannelWebhookNotSupported","errorType":"error_code","errorClass":"AppException","httpStatus":null,"severity":"error","filePath":"project/aitoearn-backend/apps/aitoearn-server/src/core/channels/platforms/platforms.service.ts","lineNumber":98,"sourceCode":"      data: parsedData,\n      credential: {\n        accessToken: credential.accessToken,\n        refreshToken: credential.refreshToken,\n        platformUid: account.uid,\n        account: account.account,\n      },\n    }))\n  }\n\n  async dispatchWebhook(platform: AccountType, request: Request, response: Response): Promise<void> {\n    const handler = this.registry.getWebhook(platform)\n    if (!handler) {\n      this.logger.warn({\n        platform,\n        method: request.method,\n        url: request.originalUrl,\n      }, 'Webhook is not supported by platform')\n      throw new AppException(ResponseCode.ChannelWebhookNotSupported, { platform })\n    }\n\n    this.logger.log({\n      platform,\n      method: request.method,\n      url: request.originalUrl,\n    }, 'Dispatching platform webhook')\n    await handler.handle(request, response, { platform })\n    if (!response.headersSent) {\n      const exception = new ChannelPlatformException({\n        code: ResponseCode.ChannelWebhookPublishFailed,\n        platform,\n        category: PlatformErrorCategory.WebhookInvalid,\n        context: {\n          method: request.method,\n          endpoint: request.originalUrl,\n        },\n        cause: {","sourceCodeStart":80,"sourceCodeEnd":116,"githubUrl":"https://github.com/yikart/AiToEarn/blob/d3aa8bea5b146a8675607cf0144d891aad3e9683/project/aitoearn-backend/apps/aitoearn-server/src/core/channels/platforms/platforms.service.ts#L80-L116","documentation":"dispatchWebhook routes an inbound HTTP webhook (method + originalUrl) to the platform's registered PlatformWebhookHandler. When registry.getWebhook(platform) returns undefined — the platform exists but registered no webhook handler — the service logs a warning and throws ChannelWebhookNotSupported with the platform in the details. It means this platform's integration cannot process callbacks at that URL.","triggerScenarios":"Configuring an external platform's webhook/callback URL to point at this service for a platform whose integration has no webhook handler, or an external system POSTing callback events for a platform integrated without webhook support; any method/URL dispatched to the platform webhook route that resolves to a null handler.","commonSituations":"Copy-pasting a webhook configuration (e.g. Meta-style callback URLs) across platforms; the platform integration's webhook handler removed or feature-flagged off; scammers/bots probing the webhook endpoint with arbitrary platform paths.","solutions":["Verify the callback URL configured on the external platform matches a platform that registers a webhook handler; correct the configuration on the provider's developer console.","Check capabilities.webhook.supported in the platform metadata before exposing or advertising a webhook URL for that platform.","If the platform should receive webhooks, implement PlatformWebhookHandler and set integration.webhook in the integration.","At the HTTP edge, return a clear 4xx for this code and avoid retries from the upstream provider."],"exampleFix":"// before\nwebhookUrl = `${baseUrl}/api/webhooks/${platform}` // assumed all platforms support it\n// after\nif (!platformMeta.webhook.supported) {\n  throw new Error(`${platform} does not support webhooks`)\n}\nwebhookUrl = `${baseUrl}/api/webhooks/${platform}`","handlingStrategy":"validation","validationCode":"const meta = platformMetadata[platform]\nif (!meta?.webhook.supported) {\n  throw new BadRequestException(`${platform} has no webhook handler`)\n}","typeGuard":"function hasWebhookHandler(integration: PlatformIntegration): integration is PlatformIntegration & { webhook: PlatformWebhookHandler } {\n  return Boolean(integration.webhook)\n}","tryCatchPattern":"try {\n  return await webhookService.dispatch(platform, request)\n} catch (e) {\n  if (e instanceof AppException && e.code === ResponseCode.ChannelWebhookNotSupported) {\n    reply.code(404).send({ error: `No webhook handler for ${e.details.platform}` })\n    return\n  }\n  throw e\n}","preventionTips":["Only configure callback URLs on external platforms whose integration registers a webhook handler.","Check capabilities.webhook.supported before exposing webhook URLs.","Verify provider developer-console webhook configuration after deploys or integration changes.","Return a definitive 4xx so upstream providers stop retrying."],"tags":["webhook","platform-capability","integration"],"backgroundTag":"webhook-not-supported","analyzedSha":"d3aa8bea5b146a8675607cf0144d891aad3e9683","analyzedAt":"2026-08-31T14:19:24.185Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}