[Bug]: Inconsistent Use of "wait" vs "waiting" in BullMQ
Version
5.41.5
Platform
NodeJS
What happened?
🛠 Inconsistent Use of "wait" vs "waiting" in BullMQ
Description
BullMQ inconsistently uses "wait" in some functions and "waiting" in others, leading to confusion when working with job states.
Steps to Reproduce
- Call
queue.getJobCounts(), and it returns{ waiting: 10, active: 5, completed: 20 }. - Call
queue.clean(0, 100, "wait"), and it works, butqueue.clean(0, 100, "waiting")does not, adding to the inconsistency.
Expected Behavior
- The job state naming convention should be consistent across all functions.
- Either
"wait"or"waiting"should be used everywhere, not a mix of both.
Actual Behavior
queue.getJobCounts()uses"waiting", whilequeue.clean()expects"wait".- This inconsistency makes it difficult for developers to predict the correct parameter.
Screenshots / Logs
// Output of queue.getJobCounts()
{
"waiting": 10,
"active": 5,
"completed": 20
}
// queue.clean() usage
await queue.clean(0, 100, "wait"); // ✅ Works
await queue.clean(0, 100, "waiting"); // ❌ Fails
// Expected: Either "wait" or "waiting" should be used consistently.
### How to reproduce.
_No response_
### Relevant log output
```shell
Code of Conduct
- [x] I agree to follow this project's Code of Conduct
thanks @azharuniverse, this is fair. But deprecating one of those parameter names would imply a breaking change. I'll take this issue in mind for next breaking change version
2. Call
queue.clean(0, 100, "wait"), and it works, butqueue.clean(0, 100, "waiting")does not, adding to the inconsistency.
I think we could support "waiting" as well in clean, and if so it would not be a breaking change.
:tada: This issue has been resolved in version 5.56.8 :tada:
The release is available on:
Your semantic-release bot :package::rocket: