Skip to content

Restore negative duration validation in JobSnooze - #1529

Merged
bgentry merged 3 commits into
riverqueue:masterfrom
Md-Talim:fix-job-snooze-negative-duration
Oct 23, 2026
Merged

bgentry merged 3 commits into
riverqueue:masterfrom
Md-Talim:fix-job-snooze-negative-duration

Conversation

@Md-Talim

Copy link
Copy Markdown
Contributor

Closes #1454

Summary

JobSnooze previously validated negative durations, but the validation was lost when the function was moved into error.go during the job-executor refactor. This restores the documented behavior and adds public-API regression coverage.

Changes

  • Restore the panic for negative durations, preserving the original panic message.
  • Add regression tests for negative durations.
  • Verify that zero and positive durations remain valid.

Testing

  • go test . -run '^TestJobSnooze' -count=1 -v
  • go test . -run '^TestJobSnooze$' -count=1

The focused tests pass.

@Md-Talim Md-Talim changed the title fix: restore negative duration validation in JobSnooze Restore negative duration validation in JobSnooze Oct 23, 2026
@brandur

brandur commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

Thanks! Do you want to throw a changelog entry in there too?

fix lint error
add changelog entry for negative duration validation
@Md-Talim

Copy link
Copy Markdown
Contributor Author

Added a changelog entry under Unreleased. Fixed and addressed the lint error. Thanks!

@Md-Talim Md-Talim closed this Oct 23, 2026
@Md-Talim Md-Talim reopened this Oct 23, 2026
@bgentry
bgentry merged commit 8d71ca8 into riverqueue:master Oct 23, 2026
15 checks passed
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.

JobSnooze accepts negative durations despite documented panic contract

3 participants