Message with expired claim is still listed as claimed in v1.1 and v2 APIs

Bug #1579595 reported by Eva Balycheva
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
zaqar
New
Undecided
Eva Balycheva

Bug Description

I'm not sure it's a bug. At first glance it's a bug.

The problem occurs on Zaqar's API v1.1 and API v2 only.
On API v1 there's no such problem.

How to reproduce:
1. Post a message (with reasonably long TTL)
2. Claim it with short TTL
3. Wait for claim to expire
4. Get the message by id or list it in the queue. And see that the claim id is included in "href" field. Here's listing response, for example:
{"messages": [{"body": "somemessage", "age": 170, "href": "/v2/queues/my-lovely-queue/messages/572fe15892d702510a04545d?claim_id=572fe18392d702510a04545e", "id": "572fe15892d702510a04545d", "ttl": 800}], "links": [{"href": "/v2/queues/my-lovely-queue/messages?marker=1&echo=true", "rel": "next"}]}

Eva Balycheva (ubershy)
Changed in zaqar:
assignee: nobody → Eva Balycheva (ubershy)
Revision history for this message
wangxiyuan (wangxiyuan) wrote :

in step4, we can use GET /v2/queues/{queue_id}/messages/{message_id} to get the message after claim expired. So the request works well.

And the "href" include a claim id in a unclaimed message. I think it is useful to indicate that whether this message is a new one or has been consumed before.

So IMO it's not a bug in this use case at least. But maybe it will confuse users more or less. Perhaps we could do it in a better way?

Revision history for this message
Eva Balycheva (ubershy) wrote :

Yes, as I said in step 4, get message by id request works. But incorrect too, I think.

Here's the example response:
{"body": "somemessage", "age": 295, "href": "/v2/queues/my-lovely-queue/messages/573052ef92d702510a045461?claim_id=573052fe92d702510a045462", "id": "573052ef92d702510a045461", "ttl": 800}

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.