This repository was archived by the owner on Jun 21, 2023. It is now read-only.
Make PR list handle errors more gracefully. #1776
Merged
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.
This PR improves the error handling of the new PR list. It's still not perfect, but better than before. Before, the list continued forever to make requests to the server if a request failed (!).
Also added some unit tests.
Testing
The best way to test this is to install Fiddler https://www.telerik.com/download/fiddler and use its Autoresponder to return error codes from
https://api.github.com. Then toggle the autoresponder on/off at various times in the loading of the PR list.The main thing that should not happen is that the PR list shouldn't repeatedly send the same failing request over and over. The second thing that should happen is that an error message should be displayed; disabling the autoresponder and clicking Refresh should load the list.
There is one place where refreshing the list fails, and you're stuck with the error - if the error occurs early enough in the load. This will require a bit more work, so I will address in another PR to keep things in reviewable-pieces.
Depends on #1773