qstash-js
qstash-js copied to clipboard
Unexpected Upstash-Deduplication-Id / Upstash-Content-Based-Deduplication behavior
Steps to reproduce:
1: Create new scheduled tast:
POST https://qstash.upstash.io/v1/publish/<my_webworker_url> Headers Upstash-Cron: * * * * * Upstash-Deduplication-Id: abcd
Response: HTTP 201 Created Body: { "scheduleId": "scd_uniqueId" "}
2: Verify that deduplication is working by repeating step 1
Response: HTTP 202 Accepted
3: Delete schedule
DELETE https://qstash.upstash.io/v1/schedules/scd_uniqueId
Response: HTTP 202 Accepted Body: { "status": "accepted" }
4: Go to https://console.upstash.com/qstash?tab=details and verify that scheduled task deleted
5: Attempt to create new schedule task as in step 1
Response: HTTP 202 Accepted Body: { "scheduleId": "scd_uniqueId" "}
Notice that scheduled task was NOT created which is unexpected as it was just deleted one step ago and so using same Upstash-Deduplication-Id should be allowed.
Same happens with Upstash-Content-Based-Deduplication: true
Deduplication ids are cached for 90 days currently. so this is expected I believe
I'm running into the same issue, can I recreate the schedule with the same Deduplication ID if it's already deleted? @chronark, is there any option to remove it from the cache?
Hi @santhosh-ps,
This issue is from QStash v1. We now have v2.
Can you provide more details about what you want to achieve?
If you want to make sure that a schedule doesn't get created twice, you can use Upstash-Schedule-Id header.