Hi,
I am setting some data via Data Storage API inside onTicketEvent
handler method. I am using ttl
param to ensure their removal as soon as the job is done and setIf
to ensure a one-time operation in case of duplicate events.
However, it’s returning 400 Error message, even when the key-value association should not exist (expired ttl
). The $db.set command is as follows:
$db.set(`requester_${requesterId}`, { "ticketId": originalTicket['id'] }, {ttl: 5, setIf: "not_exist"})
It mostly goes into error block and returns the following error:
Ticket ID: XYZ - {"status":400,"message":"The setIf conditional request failed","errorSource":"APP"}
The assumption would be that the key already exists. However, to confirm, I have set a temporary recurring job checking the existence of one hardcoded Requester ID. That record always returns:
{"status":404,"message":"Record not found"}
Let me know if more context is needed.
Edit: This works locally and creates entry in localstore
file and returns 400 only when data actually exists.