{"record":{"id":"2587c2cdb7b2a5ad","repo":"xai-org/x-algorithm","slug":"field-ids-in-event-type-config-eventtype-are-no","errorCode":null,"errorMessage":"Field Ids in event type ${config.eventType} are not unique.","messagePattern":"Field Ids in event type (.+?) are not unique\\.","errorType":"validation","errorClass":"ConfigFailure","httpStatus":null,"severity":"error","filePath":"botmaker/src/scala/com/twitter/botmaker/runtime/config/EventTypeConfigs.scala","lineNumber":59,"sourceCode":"trait EventTypeConfigs extends ServiceConfigs {\n\n  final private val eventTypes = mutable.Map[String, BotMakerEventTypeConfig]()\n\n  final def getEventTypes: Map[String, BotMakerEventTypeConfig] = eventTypes.toMap\n\n  final def addEventType(config: BotMakerEventTypeConfig): Option[BotMakerEventTypeConfig] = {\n\n    unique(EventType, config.eventType)\n    validateEventType(config.eventType)\n\n    config.inputFeatures.asScala foreach { fc => validateFieldName(fc.fieldName) }\n\n    if (config.inputFeatures.asScala.map(_.fieldName).toSet.size != config.inputFeatures.size) {\n      throw ConfigFailure(s\"Field names in event type ${config.eventType} are not unique.\")\n    }\n\n    if (config.inputFeatures.asScala.map(_.fieldId).toSet.size != config.inputFeatures.size) {\n      throw ConfigFailure(s\"Field Ids in event type ${config.eventType} are not unique.\")\n    }\n\n    eventTypes.put(config.eventType, config)\n  }\n\n  override def debug(dbg: RuntimeDebugger): Unit = {\n\n    super.debug(dbg)\n\n    dbg.open(\"eventTypes\", eventTypes) foreach { d =>\n      eventTypes foreach {\n        case (name, config) =>\n          d.info(name, config.toString)\n      }\n    }\n  }\n\n  override def compilerBuilder[E <: ServiceContainer: ClassTag]: CompilerBuilder[E] = {","sourceCodeStart":41,"sourceCodeEnd":77,"githubUrl":"https://github.com/xai-org/x-algorithm/blob/24c60942c5c5fdad3a6addffb4c6e6d2f228f04f/botmaker/src/scala/com/twitter/botmaker/runtime/config/EventTypeConfigs.scala#L41-L77","documentation":"ConfigFailure thrown when an event type's inputFeatures contain duplicate fieldId values (the numeric IDs), analogous to the field-name check. Field IDs must be unique within an event type so encoding is unambiguous.","triggerScenarios":"Two input features sharing the same fieldId in one event type — often after renumbering or merging feature definitions.","commonSituations":"Appending features with IDs copied from another event type; thrift ID renumbering collisions during schema evolution.","solutions":["Assign unique fieldId values to every feature in the event type","Audit the feature ID allocation table after merging event types"],"exampleFix":"# before\ninput_features: [{fieldId: 1, fieldName: a}, {fieldId: 1, fieldName: b}]\n# after\ninput_features: [{fieldId: 1, fieldName: a}, {fieldId: 2, fieldName: b}]","handlingStrategy":"validation","validationCode":"val ids = config.inputFeatures.asScala.map(_.fieldId)\nrequire(ids.size == ids.toSet.size, s\"duplicate fieldIds: ${ids.toSeq.groupBy(identity).filter(_._2.size>1).keys}\")","typeGuard":null,"tryCatchPattern":"catch { case e: ConfigFailure => report duplicate IDs and the owning features }","preventionTips":["Allocate field IDs from a single counter/registry","Check ID collisions when copying features between event types"],"tags":["config-validation","scala","duplicate-keys"],"backgroundTag":"duplicate-field-ids","analyzedSha":"24c60942c5c5fdad3a6addffb4c6e6d2f228f04f","analyzedAt":"2026-08-28T11:40:14.686Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}