upstash / qstash-js

Message queue for serverless
https://docs.upstash.com/qstash
MIT License
158 stars 15 forks source link

DLQ listMessages error #51

Closed lucasishuman closed 1 year ago

lucasishuman commented 1 year ago

Using: @upstash/qstash 2.1.2

When I try to get a list of DLQ messages, it is throwing an error:

const qStashClient = new Client({
  token: QSTASH_TOKEN,
});

try {
  const messages =  await qStashClient.dlq.listMessages();
} catch (err) {
  console.warn('Error getting dead messages', err);
}

Console output: Error getting dead messages QstashError: Method Not Allowed

Has this endpoint (and delete DLQ message) been implemented in the lib / v2 endpoint?

Thanks.

lucasishuman commented 1 year ago

Actually, it looks like this endpoint works: https://qstash.upstash.io/v2/dlq

But this (shown in API docs + used in lib) does not... https://qstash.upstash.io/v2/dlq/messages

So that's the root issue.

chronark commented 1 year ago

yup, we had an error in our docs and sdk, it should be /v2/dlq upgrade to latest and it'll work :)