Closed GiovaniMFMurari closed 6 days ago
Hi there,
There seems to be an issue in how we set the Upstash-Content-Based-Deduplication
header like you said.
We will fix it to work like this:
if (request.contentBasedDeduplication) {
headers.set("Upstash-Content-Based-Deduplication", "true");
}
Hi,
We have noticed a strange behaviour when trying to avoid deduplication on message publishing, for a specific use-case.
The type specification describes the property
contentBasedDeduplication
of the messaging publishing requests, given by the typePublishRequest
as a boolean with default false. But when parsing the js request object properties to the Qstash HTTP request headers it sets the value to "true" whenever the value incontentBasedDeduplication
is not undefined. So when passingcontentBasedDeduplication
asfalse
, it stills set the header value totrue
, deduplicating the message anyway. (See: https://github.com/upstash/qstash-js/blob/main/src/client/utils.ts#L50)IMO although an easy workaround would be passing undefined, or not passing the value at all, it should set the value to what the user passes, accordingly to the type specification.