{"record":{"id":"8f0259090d9b9593","repo":"temporalio/temporal","slug":"unsupported-deduplication-key","errorCode":null,"errorMessage":"unsupported deduplication key","messagePattern":"unsupported deduplication key","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"common/definition/resource_dedup.go","lineNumber":64,"sourceCode":"\t\tid: newID,\n\t}\n}\n\n// GetID returns id of EventReappliedID\nfunc (e EventReappliedID) GetID() string {\n\treturn e.id\n}\n\n// GenerateDeduplicationKey generates deduplication key\nfunc GenerateDeduplicationKey(\n\tresource DeduplicationID,\n) string {\n\n\tswitch resource.(type) {\n\tcase EventReappliedID:\n\t\treturn generateKey(eventReappliedID, resource.GetID())\n\tdefault:\n\t\tpanic(\"unsupported deduplication key\")\n\t}\n}\n\nfunc generateKey(resourceType int32, id string) string {\n\treturn fmt.Sprintf(resourceIDTemplate, resourceType, id)\n}\n","sourceCodeStart":46,"sourceCodeEnd":71,"githubUrl":"https://github.com/temporalio/temporal/blob/bde624efd13fbd3843654058db6d9c716166318b/common/definition/resource_dedup.go#L46-L71","documentation":"GenerateDeduplicationKey builds a dedup key by switching on the resource type; only EventReappliedID is supported, so any other definition.Resource implementation reaches the default branch and panics. Adding a new resource type without extending this switch is the typical cause.","triggerScenarios":"Calling GenerateDeduplicationKey (directly or via IsResourceDuplicated / UpdateDuplicatedResource) with a resource that does not implement EventReappliedID — e.g. a newly added resource type or a wrongly-typed variable.","commonSituations":"Developers adding new definition.Resource implementations (tests or new features) who forget to add a case to the switch; passing an interface value that satisfies the interface but isn't the supported concrete type.","solutions":["Ensure the passed resource implements EventReappliedID (has GetID() under the event-reapplied semantic)","Add a new case to the type switch in GenerateDeduplicationKey for the new resource type","Audit call sites (IsResourceDuplicated, UpdateDuplicatedResource, tests) for which types they pass"],"exampleFix":"// before\nswitch resource.(type) {\ncase EventReappliedID:\n    return generateKey(eventReappliedID, resource.GetID())\ndefault:\n    panic(\"unsupported deduplication key\")\n}\n// after\nswitch resource.(type) {\ncase EventReappliedID:\n    return generateKey(eventReappliedID, resource.GetID())\ncase MyNewResourceID:\n    return generateKey(myNewResourceID, resource.GetID())\ndefault:\n    panic(\"unsupported deduplication key\")\n}","handlingStrategy":"type-guard","validationCode":null,"typeGuard":"_, ok := resource.(EventReappliedID)","tryCatchPattern":null,"preventionTips":["Extend the type switch with new resource types","Unit test every resource type"],"tags":["go","panic","type-switch","deduplication"],"backgroundTag":"unsupported-resource-type","analyzedSha":"bde624efd13fbd3843654058db6d9c716166318b","analyzedAt":"2026-09-01T07:18:39.080Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}