fix(ActiveJob): handle explicitly-nil priority - #119
Merged
Conversation
This was referenced Aug 4, 2026
smudge
marked this pull request as draft
August 4, 2026 23:14
smudge
marked this pull request as ready for review
August 4, 2026 23:14
samandmoore
previously approved these changes
Aug 5, 2026
| it 'ignores a nil priority, applying the default instead' do | ||
| JobClass.set(priority: nil).perform_later | ||
|
|
||
| expect(enqueued_delayed_jobs.last.priority).to eq(10) |
Member
There was a problem hiding this comment.
we could use a reference to the default priority here if we wanna make this tolerable of change to that value.
betterment-policy-bot-production
Bot
dismissed
samandmoore’s stale review
August 7, 2026 18:58
Invalidated by push of e86b5fb
samandmoore
previously approved these changes
Aug 7, 2026
betterment-policy-bot-production
Bot
dismissed
samandmoore’s stale review
August 7, 2026 19:53
Invalidated by push of 1f6c75a
It appears that newer versions of ActiveJob's retry_on always pass priority (nil unless specified) to retry_job, so `opts.key?(:priority)` coerced `nil` into `0`. This means that every `retry_on` retry was silently re-enqueued at priority 0 (unless otherwise specified in the `retry_on` declaration). stack-info: PR: #119, branch: smudge/stack/2
samandmoore
approved these changes
Aug 7, 2026
smudge
added a commit
that referenced
this pull request
Aug 12, 2026
In testing the rollout of [the `Delayed::Limit` concurrency limiter](#116) feature, we determined that there were several quality-of-life improvements that could be made to this gem's integration with `ActiveJob` (specifically in the usage of the `retry_on` directive). As such, this release rolls in both #116 and a list of improvements to the way that `JobWrapper` and `JobPreparer` handle the lifecycle across `delayed`'s execution layer and `ActiveJob`'s execution layer: - #119 - #120 - #121 - #122 - #123 - #124 - #127
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.
It appears that newer versions of ActiveJob's retry_on always pass priority (nil unless specified) to retry_job, so
opts.key?(:priority)coercednilinto0.This means that every
retry_onretry was silently re-enqueued at priority 0 (unless otherwise specified in theretry_ondeclaration).