temporalio/temporal · error

unsupported deduplication key

Error message

unsupported deduplication key

What it means

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.

Source

Thrown at common/definition/resource_dedup.go:64

		id: newID,
	}
}

// GetID returns id of EventReappliedID
func (e EventReappliedID) GetID() string {
	return e.id
}

// GenerateDeduplicationKey generates deduplication key
func GenerateDeduplicationKey(
	resource DeduplicationID,
) string {

	switch resource.(type) {
	case EventReappliedID:
		return generateKey(eventReappliedID, resource.GetID())
	default:
		panic("unsupported deduplication key")
	}
}

func generateKey(resourceType int32, id string) string {
	return fmt.Sprintf(resourceIDTemplate, resourceType, id)
}

View on GitHub (pinned to bde624efd1)

Solutions

  1. Ensure the passed resource implements EventReappliedID (has GetID() under the event-reapplied semantic)
  2. Add a new case to the type switch in GenerateDeduplicationKey for the new resource type
  3. Audit call sites (IsResourceDuplicated, UpdateDuplicatedResource, tests) for which types they pass

Example fix

// before
switch resource.(type) {
case EventReappliedID:
    return generateKey(eventReappliedID, resource.GetID())
default:
    panic("unsupported deduplication key")
}
// after
switch resource.(type) {
case EventReappliedID:
    return generateKey(eventReappliedID, resource.GetID())
case MyNewResourceID:
    return generateKey(myNewResourceID, resource.GetID())
default:
    panic("unsupported deduplication key")
}
Defensive patterns

Strategy: type-guard

Type guard

_, ok := resource.(EventReappliedID)

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of temporalio/temporal@bde624efd1 (2026-09-01). Data as JSON: /api/errors/8f0259090d9b9593. Report an issue: GitHub.