Reject a non-positive PollingInterval in Start - #60
Merged
matt-edmondson merged 1 commit intoSep 27, 2026
Merged
Conversation
Start never checked PollingInterval, so a bad value surfaced later inside the polling loop: a negative interval faulted the loop after the first run, Timeout.InfiniteTimeSpan left Restart() and Stop() waiting on a delay that never ends, and zero spun a core. Start now throws ArgumentOutOfRangeException for any interval that is not greater than zero, where the value is supplied. Fixes #53 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018fKEEvMM2dQpZfMjTCXhRL
|
matt-edmondson
deleted the
claude/intervalaction-53-validate-polling-interval
branch
September 27, 2026 15:11
This was referenced Sep 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Fixes #53
What was wrong
IntervalAction.Startchecked the options and the action for null but never checkedPollingInterval, so a bad value only surfaced later inside the polling loop:Task.Delaythrew and leftPollingTaskfaulted, with nothing reporting it.Timeout.InfiniteTimeSpanleftRestart()andStop()waiting on a delay that never ends.Change
Startnow throwsArgumentOutOfRangeExceptionwhenPollingInterval <= TimeSpan.Zero. The check coversInfiniteTimeSpan, which is −1 ms. The exception is documented onStart.I didn't include the optional cancellable delay from the issue. That change overlaps the restart logic that #55 is already changing for #52, so it is better done after #55 lands. This branch merges cleanly with #55.
Tests
StartNonPositivePollingIntervalThrowscovers −2 s, 0 andInfiniteTimeSpan, as the acceptance criteria ask.🤖 Generated with Claude Code
https://claude.ai/code/session_018fKEEvMM2dQpZfMjTCXhRL
Generated by Claude Code