This repository was archived by the owner on Jun 5, 2025. It is now read-only.
Workaround for GetQueryResultCountAsync not working as expected#156
Merged
Workaround for GetQueryResultCountAsync not working as expected#156
Conversation
ssparach
approved these changes
Apr 16, 2024
krschau
approved these changes
Apr 16, 2024
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of the pull request
The endpoint of GetQueryResultCountAsync has a header bug which makes it unusable to us. This fix works around that endpoint so we do not need it to have functional widgets.
However, while Query Tiles widget will work, but it will not show any count higher than 25, as that is the size of the work items we pull for the Query Results. In addition, the Query Result widget will not show an indicator that more than 25 results were found at the bottom of the widget. It only shows 25 and used the count to identify when more than 25 were found.
The Query Tiles widget will show ">25" when it has more than 25 results so the user is not mislead into thinking there are 25 results when there are in fact more than 25. Since we do not know exactly, we will display > 25.
Due to the above two reductions in functionality, this is not a permanent fix; this is a temporary fix to get Query Result widget functional and Query Tiles with limited functionality. We will want to revert this commit and use GetQueryResultCountAsync once the endpoint fix is deployed. The ETA for that is a few weeks, so likely reverted in the next AzureExtension release.
References and relevant issues
Closes #155
Detailed description of the pull request / Additional comments
After discussion with Azure team it was identified that the endpoint GetQueryResultCountAsync has a header bug, and while that is being fixed by Azure, we are broken until the fix is deployed unless we stop using that endpoint. This fix stops calling that endpoint and instead gets the count another way, by using the count of WorkItemIds used by the Query Results.
However, the WorkItemId count is capped at 25 for performance reasons, which means Query Tiles will not have the true count of work items for a query. It will instead be capped at 25, so queries with more than 25 results will show only 25. While this is not ideal, it is better than a broken widget.
This fix is intended to unblock widgets from not working at all by not calling GetQueryResultCountAsync, and use the work item id count instead. This number will be the equivalent when results are <= 25, but incorrect when results are greater than 25. We will not know the total count because the endpoint to get that information is not working.
Validation steps performed
PR checklist