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

Improvements for missing file checks #4213

Merged
merged 9 commits into from
Sep 30, 2024

Conversation

HebaruSan
Copy link
Member

@HebaruSan HebaruSan commented Sep 30, 2024

Background

As of #4067, manually deleting files installed by CKAN causes that mod to be shown as having an update that reinstalls the mod to restore the deleted files. This is to ensure that all CKAN-installed mods are installed correctly according to the instructions in their metadata.

Problems

  • If you click Update all, the update checkbox for such mods (or for mods with changed metadata) is not checked
  • If you check the Update checkbox for a mod, the changeset is updated with the corresponding action, but unchecking it does not refresh the changeset
  • Users may delete certain files from certain mods to disable the functionality from that file. This use case is a good fit for Global install filters #3458's installation filters, and they do work for this, but the user experience is clunky and can require patience and workarounds:
    • The Contents tab does not obey the installation filters, so it looks like filtered-out files are missing when they aren't supposed to be installed
    • After you edit the installation filters, you have to reinstall the mod to update the installed module metadata, then update the mod list to get it to actually show up as not missing the files
  • FerramAerospaceResearch contains a file FARForceDataUpdate.cfg that it deletes at run-time, which CKAN then detects as a missing file and prompts the user to re-install.
    image

Causes

  • The Update all button is implemented by setting the mod's selected version equal to its latest compatible version. This is already the case for a re-install step, so this doesn't cause its checkbox to become checked.
  • Installation filters weren't well-integrated into other features because it wasn't clear it was needed or how it should have been done
  • I do not know why FAR does this, but the file is quite old. Maybe it was to affect the Module Manager cache in a particular way? I have queried the modder meta-brain and will update if anybody knows the relevant history.

Changes

  • Now the Update all button checks all of the update checkboxes regardless of the type of change they represent.
    Fixes [Bug]: Update all not checking the checkbox for mods with missing files #4207.
  • Now unchecking the Update checkbox refreshes the changeset
  • Now the installation filters work better as a way to tell CKAN about files you don't want installed (fixes [Feature] Ability to suppress missing file checks for user-deleted files #4205):
    • The Contents tab obeys the installation filters immediately, so files that you have filtered out won't be shown, and also will not trigger a prompt for re-installation, without having to re-install the mod
    • Changing the installation filters causes the mod list and the Contents tab to be refreshed
    • Note that the installation filters are not a good fit for the FAR scenario described above, because the FARForceDataUpdate.cfg file should be installed at least once (and presumably re-installed at each upgrade) to ensure the mod works as it's supposed to.
  • Now it is possible to create a label with a new "Ignore missing files" option. A mod that does this behavior of deleting its own file can be marked with such a label to suppress re-installation prompting.
    image
    Fixes [Feature] Ability to suppress missing file checks for files auto-deleted by mods #4204.
    • Adding or removing such a label caused the next mod in the list to be selected. Now the same mod remains selected.
    • Adding or removing such a label immediately updates its row in the mod list and the Content tab
    • Note that such a label is not a good fit for files the user intentionally deletes, because upgrading the mod or uninstalling and then installing it again later will restore the file, whereas using an installation filter will always ensure it is never installed in the first place.
  • Now the Contents tab has a red alert icon on it when files are missing, to help the user figure out why the mod has an Update checkbox available
    image

@HebaruSan HebaruSan added Bug Something is not working as intended Enhancement New features or functionality GUI Issues affecting the interactive GUI Core (ckan.dll) Issues affecting the core part of CKAN labels Sep 30, 2024
@HebaruSan HebaruSan merged commit b5736f4 into KSP-CKAN:master Sep 30, 2024
3 checks passed
@HebaruSan HebaruSan deleted the feature/contents-installed branch September 30, 2024 03:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is not working as intended Core (ckan.dll) Issues affecting the core part of CKAN Enhancement New features or functionality GUI Issues affecting the interactive GUI
Projects
None yet
1 participant