{"record":{"id":"52fb57a49325e183","repo":"yikart/AiToEarn","slug":"channelplatformoperationnotsupported-52fb57","errorCode":"ChannelPlatformOperationNotSupported","errorMessage":"ResponseCode.ChannelPlatformOperationNotSupported","messagePattern":"ResponseCode\\.ChannelPlatformOperationNotSupported","errorType":"exception","errorClass":"AppException","httpStatus":null,"severity":"warning","filePath":"project/aitoearn-backend/apps/aitoearn-server/src/core/channels/platforms/bilibili/bilibili-publish-options.provider.ts","lineNumber":29,"sourceCode":"import { BilibiliService } from './bilibili.service'\n\n@Injectable()\nexport class BilibiliPublishOptionsProvider implements PublishOptionSourceProvider {\n  constructor(private readonly bilibiliService: BilibiliService) {}\n\n  listSources() {\n    return [{\n      field: 'tid',\n      label: 'Archive Type',\n      description: 'Bilibili archive partition',\n      valueType: PublishOptionValueType.Tree,\n      requiresAccount: true,\n    }]\n  }\n\n  async getValues(input: PublishOptionValuesInput): Promise<PublishOptionValuesResult> {\n    if (input.field !== 'tid') {\n      throw new AppException(ResponseCode.ChannelPlatformOperationNotSupported, {\n        platform: AccountType.Bilibili,\n        field: input.field,\n      })\n    }\n\n    const archiveTypes = await this.bilibiliService.listArchiveTypes(input.credential.accessToken)\n    return {\n      field: 'tid',\n      valueType: PublishOptionValueType.Tree,\n      items: archiveTypes.map(item => this.toItem(item)),\n    }\n  }\n\n  private toItem(item: BilibiliArchiveTypeItem): PublishOptionValueItem {\n    const children = item.children?.map(child => ({\n      value: String(child.id),\n      label: child.name,\n      description: child.description,","sourceCodeStart":11,"sourceCodeEnd":47,"githubUrl":"https://github.com/yikart/AiToEarn/blob/d3aa8bea5b146a8675607cf0144d891aad3e9683/project/aitoearn-backend/apps/aitoearn-server/src/core/channels/platforms/bilibili/bilibili-publish-options.provider.ts#L11-L47","documentation":"BilibiliPublishOptionsProvider.getValues only supports the 'tid' field (archive category/type). Requesting values for any other publish-option field throws AppException ChannelPlatformOperationNotSupported with the platform and requested field in the context.","triggerScenarios":"Calling getValues with input.field set to anything other than 'tid' (e.g. 'category', 'tags', 'area') for the Bilibili platform.","commonSituations":"Generic UI renders all publish-option fields across platforms and queries Bilibili for a field the adapter never implemented; field key renamed upstream; new option field added to the interface without a Bilibili implementation.","solutions":["Only request field='tid' for Bilibili publish options; use listArchiveTypes data for category selection.","Filter the publish-options field list per platform before querying getValues.","If the field is needed, implement it in BilibiliPublishOptionsProvider (e.g. map to a Bilibili API).","Catch this code and render the option as unsupported/hidden in the UI."],"exampleFix":"// before\nawait provider.getValues({ credential, field: 'category' })\n\n// after\nawait provider.getValues({ credential, field: 'tid' })","handlingStrategy":"validation","validationCode":"const SUPPORTED_BILIBILI_FIELDS = ['tid']\nif (!SUPPORTED_BILIBILI_FIELDS.includes(input.field)) {\n  return { unsupported: true } // skip query / hide option in UI\n}","typeGuard":"function isBilibiliPublishField(f: string): f is 'tid' {\n  return f === 'tid'\n}","tryCatchPattern":"try {\n  values = await provider.getValues({ credential, field })\n} catch (e) {\n  if (e.code === 'ChannelPlatformOperationNotSupported') return null // render as unsupported\n  throw e\n}","preventionTips":["Maintain a per-platform capability map of supported publish-option fields","Filter option fields by platform capability before calling getValues","Add tests asserting each provider's supported field list"],"tags":["bilibili","publish-options","not-implemented"],"backgroundTag":"operation-not-supported","analyzedSha":"d3aa8bea5b146a8675607cf0144d891aad3e9683","analyzedAt":"2026-08-31T14:19:24.185Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}