Open davidmrdavid opened 7 months ago
would be great to add some kind of test to make sure the popReceipt is updated in future releases. This is an invariant we'd expect no matter what.
note: let's refactor as per this PR (https://github.com/Azure/durabletask/pull/1066 so that we actually update the popReceipt in the SDK queue object. Unclear yet if the PR should be merged as-is, or incorporated here. Needs some thinking.
In order to update messages on Azure Storage, we need to provide an up-to-date "popReceipt" to the Azure Storage SDK. Otherwise, the request will fail with "404"-type errors. After every message update operation, the popReceipt for a message is updated.
From recent reports, we learned that in the new Azure Storage SDK, the popReceipt of an
queueMessage
object is not automatically updated in-place when the update API is called. Instead, the update API now returns anupdateReceipt
object containing the new popRecepit, and leaves thepopReceipt
in thequeueMessage
object intact, making it stale. This suggests that we cannot simply accessqueueMessage.popReceipt
to obtain the latest receipt, instead we'll need to maintain an extra mapping between messageIds and their latest popReceipts. This PR implements a rather naive mapping, but further refinement may be needed.work in progress