{"record":{"id":"b2fcce120dfa6e4e","repo":"temporalio/temporal","slug":"s-has-unsupported-overlap-policy-v","errorCode":null,"errorMessage":"%s has unsupported overlap policy %v","messagePattern":"(.+?) has unsupported overlap policy (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"service/frontend/workflow_handler.go","lineNumber":7053,"sourceCode":"func validateTimestamp(value *timestamppb.Timestamp, field string) error {\n\tif value != nil {\n\t\tif err := value.CheckValid(); err != nil {\n\t\t\treturn fmt.Errorf(\"%s is not a valid timestamp: %w\", field, err)\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc validateScheduleRemainingActions(schedule *schedulepb.Schedule) error {\n\tif schedule.GetState().GetRemainingActions() < 0 {\n\t\treturn errors.New(\"remaining actions cannot be negative\")\n\t}\n\treturn nil\n}\n\nfunc validateScheduleOverlapPolicy(policy enumspb.ScheduleOverlapPolicy, field string) error {\n\tif _, ok := enumspb.ScheduleOverlapPolicy_name[int32(policy)]; !ok {\n\t\treturn fmt.Errorf(\"%s has unsupported overlap policy %v\", field, policy)\n\t}\n\treturn nil\n}\n\nfunc (wh *WorkflowHandler) validateScheduleOverlapPolicies(\n\tschedule *schedulepb.Schedule,\n\tpatch *schedulepb.SchedulePatch,\n\tnamespaceName string,\n) error {\n\tif schedule != nil {\n\t\tif err := validateScheduleOverlapPolicy(schedule.GetPolicies().GetOverlapPolicy(), \"schedule policies\"); err != nil {\n\t\t\treturn wh.handleScheduleValidationError(err, scheduleValidationOverlapPolicy, namespaceName)\n\t\t}\n\t}\n\tif patch == nil {\n\t\treturn nil\n\t}\n\tif trigger := patch.GetTriggerImmediately(); trigger != nil {","sourceCodeStart":7035,"sourceCodeEnd":7071,"githubUrl":"https://github.com/temporalio/temporal/blob/bde624efd13fbd3843654058db6d9c716166318b/service/frontend/workflow_handler.go#L7035-L7071","documentation":"Returned when a ScheduleOverlapPolicy value is not a recognized enum value in enumspb.ScheduleOverlapPolicy_name. This catches corrupted or out-of-range enum integers sent by clients, preventing undefined overlap behavior for schedule workflows.","triggerScenarios":"CreateSchedule/UpdateSchedule where SchedulePolicies.Overlap is set to an integer outside the known ScheduleOverlapPolicy range (e.g. raw enum value from a newer/older proto than the server supports).","commonSituations":"Proto/SDK version skew (server older than client enum); manually casting an int to the enum; corrupted persisted policy.","solutions":["Use SDK enum constants (e.g. enumspb.SCHEDULE_OVERLAP_POLICY_SKIP) instead of raw ints","Upgrade the server/SDK so proto versions align","Default to UNSPECIFIED and let the server apply its default policy"],"exampleFix":"// before\npolicy := enumspb.ScheduleOverlapPolicy(99)\n// after\npolicy := enumspb.SCHEDULE_OVERLAP_POLICY_BUFFER_ALL","handlingStrategy":"validation","validationCode":"if _, ok := enumspb.ScheduleOverlapPolicy_name[int32(policy)]; !ok { return fmt.Errorf(\"unsupported overlap policy %d\", policy) }","typeGuard":"func knownOverlapPolicy(p enumspb.ScheduleOverlapPolicy) bool { _, ok := enumspb.ScheduleOverlapPolicy_name[int32(p)]; return ok }","tryCatchPattern":"if err := validateScheduleOverlapPolicy(policy, \"overlap policy\"); err != nil { return err }","preventionTips":["Use named enum constants only","Keep SDK and server proto versions in sync","Reject raw-int casts from external input"],"tags":["enum","schedule","protobuf","validation","go"],"backgroundTag":"invalid-enum-value","analyzedSha":"bde624efd13fbd3843654058db6d9c716166318b","analyzedAt":"2026-09-01T07:18:39.080Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}