Repository navigation
Display Internet Connection Error inside Clone Repository Dialog - #6297
Daniel-McCarthy wants to merge 5 commits into
Conversation
"No internet connection." is now displayed instead of the repositories list if the loading the repositories fails. It also includes a "Try again?" button that allows manually initiating a repository re-load and render.
|
@Daniel-McCarthy 🎉 ❤️ Can I go ahead and add |
|
@billygriffin Yes, that would be great! It's ready for the first round of review. |
|
Tested the UI changes, and LGTM! |
|
@Daniel-McCarthy these are the 3 types of errors we'd get back from the API. We could open an issue to create a new Let me know if you think that would be beneficial for this PR. cc @desktop/engineering for thoughts on whether we should return an |
When loadRepositories(this.props.account) is called a render will occur, allowing the repository list to refresh and display the newly loaded repositories. Therefore this.renderRepositoryList() is not necessary and can be removed.
|
cc: @niik on this one as well as it touches the cloning dialog. |
|
Just updated the original issue body, but unfortunately this PR conflicts somewhat with #6278 so we're going to get that one landed first, and then pull this in afterward. |
Sounds great. I'm more than happy to handle the merge conflicts on my end as soon as that PR gets merged.
I'm not sure it would be vital for this pull request. I figured if there are other potential causes that would be useful to differentiate from for the user then it might be worth considering here. Depending on the information we can pass down we would potentially be able display a different error if the user's internet connection doesn't seem to be the problem. But I am not sure if the information we would get from the 3 client errors cover potential issues the user would want to know about. Even if the issue is not their connection, the "Try Again?" button this new display provides is still very useful to the user as they will want to attempt to refresh regardless of the cause. And thank you for sharing that information, it was very useful to read through. |
|
@billygriffin @niik This pull request uses the result of a I'm not sure if there's a way we can decide which to show depending on the scenario, or if we would have to keep it how it is or substitute the loading display. |
|
@Daniel-McCarthy Unfortunately I can't speak to the underlying technical tradeoff on this, so I'll have to defer to @niik or someone else in @desktop/engineering to weigh in. Thanks for succinctly explaining where the two are intersecting. |
Conflicts and design questions outstanding
|
Dropping this from |
Since the creation of these commits there have been some radical changes to the clone-repository set ofdialogs and classes. Since some of the areas that this code touches no longer exist it would be easiest to remove the changes before merging and starting over after the merge.
Previously if a list of repositories could not be loaded for a user it always say "Couldn't find any repositories" for that account. This may imply to the user they may not have any repositories. However, this may also be due to not having an internet connection when attempting to clone. Therefore if the user is connected to a network then they will be shown the "Could not find any repositories" dialog. Otherwise they will see a new "No internet connection" warning which includes a link to refresh.
|
I have looked into this further and was able to find a way to potentially reconcile the issue with the two displays that would potentially be shown if no repositories were loaded. Currently if one goes to the Clone Repository dialog in the GitHub section and no repositories are loaded for the list it will show a display saying that no repositories could be found for the account and offering a link to attempt to refresh. (This has been added since the creation of this pull request.) However, it does not imply any issues with internet connection, rather that the account itself has been checked for repositories. I mentioned prior that there were potential issues regarding detecting whether or not the user has an internet connection. I have updated this by checking the Essentially with the current updated implementation it will always show the above display unless they are not connected to another network. If they are not connected to a network it will display the original display design warning of no internet connection and offering a link to attempt to refresh, as seen here:
Additionally we can decide if this display is still wanted, given that there have been noticeable changes since the creation of the original issue. |
|
We think that using the We think you can check for this error to know for sure if there is internet access |
|
@iAmWillShepherd Okay, sounds good. I'd like to get a better idea of the proposed changes here.
I'd like to be sure this is the set of changes we would need, or if there's a different way to access this information from the Thanks for your time! |
|
I think it'd be best to seperate this PR into two distinct solutions:
Since option 2 is relatively hard and has implications outside of the clone dialog, I think starting with addressing the error dialog will give us a good starting off point to potentially solve the connectivity problem. Solving that may also address #1128 - there is a conversation here discussing an offline mode for the app. |
|
I spotted an interactions that could use some refinement. Black - Development version When connection is lost and re-gained, the component does not know this, forcing me to have to click the refresh button (You get the message saying "Couldn't find any repositories..."). I think this can happen automagically as the current production version of the app does. |
|
In talking this over with @Daniel-McCarthy, @nerdneha, and @niik, given the complexity here we all decided this probably went a little too far and our efforts (and @Daniel-McCarthy's) might better be prioritized on other things with more of a clear impact. I'm also going to close the associated issue because we haven't really heard this feedback from users as representing a real problem affecting more than a couple folks. @Daniel-McCarthy Huge thanks for your efforts here and apologies we weren't as clear on the impact here as we could've been, and I'm excited to see what you work on next! 😄 |




Overview
Closes #2796
❗️ #6278 should be merged before this one gets merged because there will likely be some conflicting things ❗️Description
Clone Repositorydialog.Additionally, a "Try again?" button has been added to allow the user to initiate an attempt to reload the repositories.
Before:

After:

Regarding the implementation of these changes, one part I would consider changing but did not initially:
When the
Clone Repositorydialog attempts to load the repositories, it callsapi.fetchRepositories(). This function returns null when it encounters an error, and logs the error. So the caller can detect when loading the repositories failed due to an error, but not which error caused it. Therefore the current implementation can potentially display this "No internet connection" error when it fails due to a different issue.If this api function instead returned an error code instead of null we could then make it only display the internet connection error when it is confirmed to be an internet issue. However, there may be another way to check this that I am not aware of.
Release notes
Notes: An error will now display in the Clone Repository dialog when internet connection issues occur.