Skip to content

Commit

Permalink
fix(job): revert console warn custom job ids when they represent inte…
Browse files Browse the repository at this point in the history
…gers (#2312)

BREAKING CHANGE

throw error when custom job ids represent integers
  • Loading branch information
roggervalf authored Dec 5, 2023
1 parent 8eee20f commit 84015ff
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
5 changes: 1 addition & 4 deletions src/classes/job.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1141,10 +1141,7 @@ export class Job<
}

if (`${parseInt(this.id, 10)}` === this.id) {
//TODO: throw an error in next breaking change
console.warn(
'Custom Ids should not be integers: https://github.com/taskforcesh/bullmq/pull/1569',
);
throw new Error('Custom Ids cannot be integers');
}

if (this.opts.priority) {
Expand Down
3 changes: 1 addition & 2 deletions tests/test_queue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ describe('queues', function () {
await connection.quit();
});

//TODO: restore this tests in next breaking change
describe.skip('.add', () => {
describe('.add', () => {
describe('when jobId is provided as integer', () => {
it('throws error', async function () {
await expect(
Expand Down

0 comments on commit 84015ff

Please sign in to comment.