Checks for workers with unique configuration but no explicit keys option.
When using unique: [fields: [:args]] without specifying keys, Oban uses
all fields from the job args for uniqueness. This can be problematic if:
- Args contain dynamic fields (timestamps, UUIDs) that should be ignored
- You want uniqueness based on only specific business identifiers
How to fix
Add explicit keys to specify which args matter for uniqueness:
use Oban.Worker,
queue: :default,
unique: [fields: [:args], keys: [:user_id, :action]]See Oban unique jobs.
Configuration
In .oban_doctor.exs:
checks: [
unique_without_keys: [
# Disable the check entirely
enabled: false,
# Or exclude specific workers from this check
excluded_workers: [MyApp.Workers.LegacyWorker]
]
]