Don't prompt user to choose conflicting modules #3434
Merged
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
A module that tries to filter an option out of the "Too many mods provide" prompt with a conflict just ends up complaining to the user after the fact:
Noticed while investigating KSP-CKAN/NetKAN#8656.
Cause
The relationship resolver relies on
AvailableModule.Latest
to generate the modules for the user prompt, which filters modules withAvailableModule.DependsAndConflictsOK
, which only checks conflicts unidirectionally.Changes
Now
AvailableModule.DependsAndConflictsOK
checks conflicts bidirectionally, so choices that the installing modules conflict with will be filtered out before (or without) prompting:Concerns
This will probably pre-empt the "{conflicting_mod} conflicts with {candidate}" message in other cases, which might be confusing. I need help identifying those cases so I can figure out how to address them. Are there other situations where a mod might depend on its own conflict?