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

Use latest compatible instead of latest available for Install checkboxes #4152

Merged
merged 5 commits into from
Aug 9, 2024

Conversation

HebaruSan
Copy link
Member

@HebaruSan HebaruSan commented Aug 8, 2024

Problems

While setting up to reproduce KSP-CKAN/NetKAN#10157 in a fake 1.9.1 instance, I noticed some problems:

  • My CKAN was trying to install the latest RealismOverhaul when I clicked its Install checkbox, which isn't compatible with KSP 1.9.1, rather than the latest compatible v13.1.1 as in that issue's screenshot
  • The GUI prompts that ask the user about auto-updating CKAN and auto-updating metadata are confusing. When I first switched into the fake 1.9.1 instance, I honestly could not tell what the first one was asking me about, since it didn't specify (the second one was clearer, but by then I already had to decide what to do about the first one).
  • The file conflict message says "Owning Mod: TweakScale" without the version, so I had to ask the author of the issue to check what the version was, even though CKAN definitely knows the version since it's an installed module.
  • Dropping SHA-1 as Stop checking multiple hashes #4135 planned to do would break importing manually-downloaded ZIP files

Causes

  • Better version specific relationships at install and upgrade #4023 set the mod to be installed to GUIMod.LatestAvailableMod, which is the absolute most recent, rather than GUIMod.LatestCompatibleMod as it should have been
  • ModuleInstaller.ImportFiles only checks the SHA-1, so any module with only an SHA-256 in download_hash would fail to be detected

Changes

  • Now we install GUIMod.LatestCompatibleMod, so the right version will be installed on old game versions
  • Now both auto-update prompts are rewritten to be hopefully easier to understand, with the parentheses removed and some newlines added for readability
    • The GUI prompt about auto-updating CKAN specifies that it is talking about updating CKAN itself
    • The GUI prompt about auto-updating metadata says that you should click Refresh once in a while if you don't auto-update and mentions the settings
  • Now the file conflict kraken captures an InstalledModule instead of a just an identifier, and renders it with InstalledModule.ToString(), which includes the version, install date, and whether it was auto-installed as a dependency of another mod
  • Now ModuleInstaller.ImportFiles first checks the SHA-256, then falls back to the SHA-1 if not found
    • Now Registry.GetSha1Index is renamed GetDownloadHashesIndex and includes both SHA-256 and SHA-1 hashes as keys in the dictionary it returns.
    • Registry.GetDownloadHashIndex is renamed to GetDownloadUrlHashIndex
    • Both Get*Index functions are refactored (and LINQified) to cache their calculated dictionaries in between repo updates, in case the user needs them multiple times in a row

@HebaruSan HebaruSan added Bug Something is not working as intended GUI Issues affecting the interactive GUI Core (ckan.dll) Issues affecting the core part of CKAN AutoUpdate Issues affecting the automatic updating labels Aug 8, 2024
@HebaruSan HebaruSan merged commit be75f8e into KSP-CKAN:master Aug 9, 2024
3 checks passed
@HebaruSan HebaruSan deleted the fix/inst-latest-compat branch August 9, 2024 00:00
@HebaruSan HebaruSan mentioned this pull request Aug 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AutoUpdate Issues affecting the automatic updating Bug Something is not working as intended Core (ckan.dll) Issues affecting the core part of CKAN GUI Issues affecting the interactive GUI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant