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.
Problem
If you try to install mods in GUI and one or more downloads errors out, it's not handled well.
DownloadErrorsKraken
thrown and caught by the uncaught exceptions handler, effectively crashing the appCause
Before #2233, GUI's downloads happened on this line:
CKAN/GUI/MainInstall.cs
Line 123 in 28c981e
That function can throw
DownloadErrorsKraken
s, and there's nothing there to catch them.After #2233, that exception is handled, but the user's change set was still being lost in a few ways:
UpdateChangesDialog
with a null parameter immediately after starting the install. This cleared theMain.changeSet
variable and the grid for previewing changes.UpdateModsList
regardless of success or failure, which rebuilds the GUIMod list from the registry. Unfortunately since each GUIMod tracks whether it is selected to install/remove/upgrade, and clicking Apply Changes rebuilds the change set from the GUIMod list, this also wiped the user's change set.CKAN/GUI/MainChangeset.cs
Lines 116 to 122 in bb02892
Changes
Handling download exceptions
#2233 can be taken as a first step towards fixing this; it moved the download process into a
try{}
block that catchesDownloadErrorsKraken
, so the user isn't confronted with a scary Continue/Quit exception popup.Preserve change set on failure
Now we take the next step: we don't reset the change set until the end of the install attempt. If the install attempt is successful, we clear the change set and rebuild the list of GUIMods, since we are done with those changes. If the attempt fails, we keep the change set and also keep the current list of GUIMods, since they are used to regenerate the change set at the start of the next install attempt (see the code block above).
Fixes #2274.
Retry button after failure
Building on these improvements, a Retry button now appears next to Cancel when an install fails, and clicking it restarts the previously attempted install process.
Consolidated download error popup
Download error reporting is now more complete and user friendly. Rather than raising up to three popups in a row for download errors and ignoring remaining errors, GUI now shows all download errors in a single popup and adds them to the progress tab's log box as well for closer examination after the popup is closed. These errors are also now formatted better in Cmdline and ConsoleUI.
Host and size shown before downloading
We also now show the download host and size before each point where the user needs to decide whether to continue in GUI:
Jump to auth token screen if a download is throttled
If a user encounters the dreaded GitHub 403 response due to download throttling, we will notify them specifically that the download was throttled, and advise them that adding an authentication token might help. Cmdline says to try the authtoken command, and ConsoleUI and GUI both provide a yes/no popup to jump to their respective auth token editing screens. If the user selects yes, the GitHub auth token wiki is opened in the system browser as well.
Fixes #1025.
Part of addressing #2210.
Don't report success after repo update fails
#1579 contains this gem:
A failure message followed by a success message. Now repo update failure will be reported as a failure and only a failure.
Fixes #1389.
Make Cancel button always work
Previously, the Cancel button on the progress screen in GUI only worked for module downloads, and not for repo updates. You could click it, but nothing happened. Now it always takes you back to the mod list.