Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't apply previous change set to checkboxes after successful install #2730

Merged
merged 1 commit into from
Apr 20, 2019

Conversation

HebaruSan
Copy link
Member

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 confuse UpdateModsList.

Fixes #2713.

@HebaruSan HebaruSan added Bug Something is not working as intended GUI Issues affecting the interactive GUI Pull request labels Apr 13, 2019
@DasSkelett DasSkelett removed the Bug Something is not working as intended label Apr 13, 2019
@HebaruSan HebaruSan added the Bug Something is not working as intended label Apr 13, 2019
Copy link
Member

@DasSkelett DasSkelett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checkboxes are marked correctly again, works!

@HebaruSan HebaruSan merged commit 1919045 into KSP-CKAN:master Apr 20, 2019
HebaruSan added a commit that referenced this pull request Apr 20, 2019
@Olympic1 Olympic1 removed Bug Something is not working as intended Pull request labels Apr 20, 2019
@HebaruSan HebaruSan deleted the fix/checkbox-state branch April 21, 2019 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GUI Issues affecting the interactive GUI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Installing specific mod version desyncs checkbox status
3 participants