KSP-CKAN / CKAN

The Comprehensive Kerbal Archive Network
https://forum.kerbalspaceprogram.com/index.php?/topic/197082-*
Other
1.99k stars 348 forks source link

Label search fixes #4187

Closed HebaruSan closed 2 months ago

HebaruSan commented 2 months ago

Problems

It has worked this way since #3323 (and #3460 even partially explained why), but no one seemed to care. Recently we finally got a report from Discord user Epsilon:

image

Cause

ModSearch stores strings for tags but ModuleLabels for labels. This was done because it's trivial to check whether a tag name matches a module by looking for it in the CkanModule.Tags property, but the label object stores which mods it contains rather than the other way around. To check label membership, you need the ModuleLabel object, so ModSearch stored them, which meant that when we translate it back into a search string, partially typed label searches could not be represented since there was no such label in the list of labels.

Changes