Don't apply previous change set to checkboxes after successful install #2730
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 install a module, and then install a different version of it by double clicking in the Versions tab of mod info, its Installed checkbox becomes unchecked even though it's still installed.
Cause
UpdateModsList
has a change set parameter to keep the mod list in sync with the active change set. If you pass a change set in this parameter, the function will apply each change in it to the freshly loaded mod list. When you install by double clicking an older version, we don't go through the main change set, but instead jump directly to installing the module.We were passing the just-completed change set to
UpdateModsList
after installation. This isn't necessary because the changes will be picked up directly from the registry, but until recently it was at least benign since the boxes it would check or uncheck were already in that state.After double clicking in the Versions tab, that call re-applies the uninstall-reinstall change set even though it's already been completed, and it isn't the active change set. And after #2669 it has a remove action for the module, which makes
UpdateModsList
think that it's been or being removed, when in reality it was immediately reinstalled.Changes
The right thing to do is to apply no change set on success, and to apply
Main.ChangeSet
on failure. Now we do that. This will ensure that our weird uninstall-reinstall change sets don't confuseUpdateModsList
.Fixes #2713.