This is effectively a refactoring, but does fix an intermittent problem in the dotnet/docs repository.
In the previous structure of the code, two queries were started immediately: one for issues, and one for PRs. Then, the different query results would be enumerated one after the other, including executing and awaiting secondary queries for more issues.
When the issues query resulted in multiple "pages", the cached results on GitHub were incorrect, and starting the enumeration of the second query failed.
The new structure wraps creating the query object, executing the initial query, and enumerating the results (including any subsequent sub-queries) in one asynchronous method. That means the first query (for issues) is enumerated completely before creating and making the first query for pull requests.
This is effectively a refactoring, but does fix an intermittent problem in the
dotnet/docs
repository.In the previous structure of the code, two queries were started immediately: one for issues, and one for PRs. Then, the different query results would be enumerated one after the other, including executing and awaiting secondary queries for more issues.
When the issues query resulted in multiple "pages", the cached results on GitHub were incorrect, and starting the enumeration of the second query failed.
The new structure wraps creating the query object, executing the initial query, and enumerating the results (including any subsequent sub-queries) in one asynchronous method. That means the first query (for issues) is enumerated completely before creating and making the first query for pull requests.