Automattic / Automattic/kue

created_at is a number when creating job but string when getting a job

Open
#1,081 4 comments 0 reactions 0 assignees View on GitHub
needs pull request
Dominant language
JavaScript
Stars
9.4k
Forks
858
PR merge metrics
No merged PRs in 30d

Description

When you create a job, created_at is a number:
`const job = queue.create(type, data)
job.save(() => {
// job.created_at is a number
}`

When you get the job, it is a string:
kue.Job.get(id, (job) => {
// job.created_at is a string here
});

Since created_at is a date number, shouldn't it be a number everywhere?
It can be easily fixed with converting it to number here:
https://github.com/Automattic/kue/blob/master/lib/queue/job.js#L195
Perhaps all the following values should be converted either?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in lib/queue/job.js around line 195, where the issue identifies the conversion for retrieved jobs. Compare created_at during job creation and retrieval, then check the other values mentioned in the issue; done means the relevant date fields have consistent types in both paths.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js, redis
Domain
backend, distributed-systems
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.