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

Recommendations with virtual dependencies don't appear in GUI #2268

Closed
HebaruSan opened this issue Jan 30, 2018 · 2 comments · Fixed by #2577
Closed

Recommendations with virtual dependencies don't appear in GUI #2268

HebaruSan opened this issue Jan 30, 2018 · 2 comments · Fixed by #2577
Labels
Bug Something is not working as intended GUI Issues affecting the interactive GUI Relationships Issues affecting depends, recommends, etc.

Comments

@HebaruSan
Copy link
Member

HebaruSan commented Jan 30, 2018

Background

CKAN Version:
1.22.6 and current HEAD

KSP Version:
1.3.1

Operating System:
Windows 7, Windows 10

Have you made any manual changes to your GameData folder (i.e., not via CKAN)?
No

Problem

What steps did you take in CKAN?

  1. Create a .netkan file with Scatterer as a recommendation
  2. Run it through netkan.exe
  3. In GUI, File → Install from .ckan...
  4. Select the .ckan file generated in step 2

What did you expect to happen?
Scatterer should appear in the list of recommended mods to install

What happened instead?
Other recommendations appear, but Scatterer doesn't.

Screenshots:
screenshot 2018-01-29 20 58 10

CKAN error codes (if applicable):

I instrumented the code with various exception handlers in Main.GetShowableMods:

Exception thrown looking up Scatterer: Exception of type 'CKAN.InconsistentKraken' was thrown.
   at CKAN.SanityChecker.EnforceConsistency(IEnumerable`1 modules, IEnumerable`1 dlls)
   at CKAN.RelationshipResolver.AddModulesToInstall(IEnumerable`1 modules)
   at CKAN.RelationshipResolver..ctor(IEnumerable`1 modules, RelationshipResolverOptions options, IRegistryQuerier registry, KspVersionCriteria kspversion)
   at CKAN.RelationshipResolver..ctor(IEnumerable`1 module_names, RelationshipResolverOptions options, IRegistryQuerier registry, KspVersionCriteria kspversion)
   at CKAN.Main.GetShowableMods(Dictionary`2 mods)
Kraken for Scatterer: The following inconsistencies were found:
Scatterer has an unmet dependency: Scatterer-sunflare is not installed
 * Scatterer has an unmet dependency: Scatterer-config is not installed

That function turns off handling of virtual mods and turns on consistency checks:

CKAN/GUI/MainInstall.cs

Lines 410 to 417 in dfd03d7

var opts = new RelationshipResolverOptions
{
with_all_suggests = false,
with_recommends = false,
with_suggests = false,
without_enforce_consistency = false,
without_toomanyprovides_kraken = true
};

Then when it does a consistency check, it discovers that Scatterer has unsatisfied dependencies, since they're virtual, and the InconsistentKraken makes it skip to the next recommendation:

CKAN/GUI/MainInstall.cs

Lines 423 to 438 in dfd03d7

try
{
var resolver = new RelationshipResolver(new List<string> { pair.Key }, opts,
RegistryManager.Instance(manager.CurrentInstance).registry, CurrentInstance.VersionCriteria());
if (!resolver.ModList().Any())
{
continue;
}
module = RegistryManager.Instance(manager.CurrentInstance)
.registry.LatestAvailable(pair.Key, CurrentInstance.VersionCriteria());
}
catch
{
continue;
}

Scatterer's metadata isn't actually invalid, so it should be possible for another mod to recommend it.

Thanks to @Sigma88 for reporting this via forum PM.

@HebaruSan HebaruSan added Bug Something is not working as intended GUI Issues affecting the interactive GUI labels Jan 30, 2018
@Sigma88
Copy link

Sigma88 commented Jan 30, 2018

thanks @HebaruSan for opening this 👍

@HebaruSan
Copy link
Member Author

New script to query relationships found one example of this in live data:

  • ExtrasolarPlanetsBeyondKerbol-stock recommends Scatterer

Confirmed that installing that mod in GUI doesn't pull in Scatterer in the recommendation list.

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 GUI Issues affecting the interactive GUI Relationships Issues affecting depends, recommends, etc.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants