-
Notifications
You must be signed in to change notification settings - Fork 591
[Bug]: Flow de-duplication behavior differs from regular jobs #3878
Copy link
Copy link
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Version
v5.70.4
Platform
NodeJS
What happened?
When working with regular jobs, a de-duplicated job returns the same job.id as the original. This makes it easy to identify duplicates when using custom job IDs, e.g..
const jobId = 'example';
const job = await queue.add(
'example',
{},
{
deduplication: { id: 'dedup' },
jobId: jobId,
}
);
if (job.id !== jobId) {
console.log('Job has been de-duplicated');
}However, this behavior does not carry over to flows. Is it expected that flows don’t return the same job.id when de-duplicated, unlike regular jobs?
How to reproduce.
const flow1 = await flow.add({
name: 'example1',
queueName: 'example',
opts: {
deduplication: { id: 'dedup' },
delay: 500,
},
});
const flow2 = await flow.add({
name: 'example2',
queueName: 'example',
opts: {
deduplication: { id: 'dedup' },
delay: 500,
},
});
if (flow1.job.id !== flow2.job.id) {
throw new Error('Expected flow IDs to be the same');
}Relevant log output
Code of Conduct
- I agree to follow this project's Code of Conduct
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working