-
Notifications
You must be signed in to change notification settings - Fork 262
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Invalid continuation token in GetStatusAsync API #1174
Comments
So, should we just test for the end of the enumeration against "bnVsbA=="? do
{
var status = await client.GetStatusAsync(queryCondition, cancellationToken);
...
queryCondition.ContinuationToken = status.ContinuationToken;
} while (queryCondition.ContinuationToken != "bnVsbA=="); If not, how do you use this API? The documentation does not mention this, or at least, I can't find it in either of these two pages. https://docs.microsoft.com/en-us/azure/azure-functions/durable/durable-functions-instance-management |
Hi @f2bo yeah, this looks pretty broken. I think your workaround for now is okay, but this definitely needs to be fixed. Thanks for raising the issue and providing a repro. |
Thanks @cgillum. Just to be safe, the fix will be to return null instead, correct? So, once the bug is fixed, we'll still be fine if we check this as: while (queryCondition.ContinuationToken != null && queryCondition.ContinuationToken != "bnVsbA=="); |
Yes, this is definitely a good idea. |
PR to handle this here: Azure/durabletask#372 |
Fixed in 2.2.0 |
Description
The new paged
GetStatusAsync
API appears to return an invalid continuation token when there are no more results.Expected behavior
The behavior is not documented, and I hadn't used this overload previously so this may be a bad assumption on my part, but I expected GetStatusAsync to return a
null
continuation token once it completes the enumeration.Actual behavior
Instead, it returns "bnVsbA==", which when base64 decoded corresponds to "null" as a string.
The loop in the following method never exits because the ContinuationToken is never null. The first iteration of the loop returns the expected results (2 in my test case) and "bnVsbA==" as the continuation token. Then it just keeps returning the same results in subsequent iterations.
App Details
The text was updated successfully, but these errors were encountered: