Automattic / Automattic/kue

Creating job with an undefined priority causes redis error

Open
#1,061 6 comments 1 reaction 0 assignees View on GitHub
Dominant language
JavaScript
Stars
9.4k
Forks
858
PR merge metrics
No merged PRs in 30d

Description

Dsing the `priority` method with an undefined value causes when creating a job causes `node_redis` to complain with:
```
node_redis: Deprecated: The HSET command contains a "undefined" argument.
This is converted to a "undefined" string now and will return an error from v.3.0 on.
Please handle this in your code to make sure everything works as you intended it to.
```

Would it not be preferable to have Kue throw an exception if the priority is undefined?
It took me some time to find the cause of this problem in my code :p

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at the priority method and follow the job-creation path that writes to Redis. Reproduce the undefined-priority case and inspect how related invalid arguments are handled. Done means Kue raises an exception instead of passing an undefined value to node_redis, with coverage for the behavior if the repository has relevant tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js, redis
Domain
backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.