qstash-js icon indicating copy to clipboard operation
qstash-js copied to clipboard

Unexpected Upstash-Deduplication-Id / Upstash-Content-Based-Deduplication behavior

Open privet-fun opened this issue 2 years ago • 3 comments

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

privet-fun avatar Jul 23 '23 16:07 privet-fun

Deduplication ids are cached for 90 days currently. so this is expected I believe

chronark avatar Jul 23 '23 17:07 chronark

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?

santhosh-ps avatar Sep 01 '24 06:09 santhosh-ps

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.

CahidArda avatar Sep 09 '24 16:09 CahidArda