Skip to content

Fix ScheduleRange validation#2971

Open
hungrytech wants to merge 1 commit into
temporalio:mainfrom
hungrytech:fix/schedule-range-end-validation
Open

Fix ScheduleRange validation#2971
hungrytech wants to merge 1 commit into
temporalio:mainfrom
hungrytech:fix/schedule-range-end-validation

Conversation

@hungrytech

@hungrytech hungrytech commented Jul 25, 2026

Copy link
Copy Markdown

What was changed

The three-argument constructor accidentally checked step twice, so negative end values were accepted. end should follow the same non-negative constraint as start and step.

Why?

ScheduleRange(int start, int end, int step) checked step >= 0 twice and did not validate end.

As a result, negative end values were accepted even though schedule range values are expected to be non-negative. This change corrects the validation while preserving the existing constructor signatures and exception behavior.

Checklist

  1. Closes ScheduleRange to check end #2728

  2. How was this tested:

  • Added ScheduleRangeTest covering negative end values in both constructors. The test fails on main and passes with this change.

@hungrytech
hungrytech requested a review from a team as a code owner July 25, 2026 02:39
@CLAassistant

CLAassistant commented Jul 25, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ScheduleRange to check end

2 participants