Skip to content

Properly recalculate compatible mods on stability tolerance change#4552

Merged
HebaruSan merged 2 commits into
KSP-CKAN:masterfrom
HebaruSan:fix/stability-override-change
Apr 11, 2026
Merged

Properly recalculate compatible mods on stability tolerance change#4552
HebaruSan merged 2 commits into
KSP-CKAN:masterfrom
HebaruSan:fix/stability-override-change

Conversation

@HebaruSan
Copy link
Copy Markdown
Member

@HebaruSan HebaruSan commented Apr 11, 2026

Problem

  1. Open CKAN with the default stability settings (stable only)
  2. Find RasterPropMonitor-Core
  3. Note that the relationships are for 1.0.2
  4. In the Versions tab, note there's a 1.0.3 prerelease
  5. Set a stability override of Testing for this mod
  6. Everything refreshes and 1.0.3 now shows up as installable
  7. However, the Relationships tab still shows the relationships for 1.0.2

Pointed out by @JonnyOThan in Discord.

Cause

CompatibilitySorter retains a readonly reference to the StabilityToleranceConfig that was used to generate its LatestCompatible property. Registry.CompatibleModules compares this property to the current settings received from its parameter and recalculates the compatible mods if needed.

That comparison gives the wrong answer because the reference held by CompatibilitySorter points to the same object that the other code modifies when you change the settings. So when the mod list is refreshed after the stability config change, the list of compatible mods is left the same as it was before, so the mod list isn't changed, and mod info receives the same mod as before.

Changes

  • Now StabilityToleranceConfig has a copy constructor that makes a deep clone, and CompatibilitySorter uses it to capture an immtuable copy of its stability settings
  • Now StabilityToleranceConfig implements IEquatable<StabilityToleranceConfig> and overrides operator!= to make sure the comparison is accurate

After this, changing the compatibility override for a mod will show the correct relationships on the Relationships tab.

@HebaruSan HebaruSan added Bug Something is not working as intended Core (ckan.dll) Issues affecting the core part of CKAN labels Apr 11, 2026
@coveralls
Copy link
Copy Markdown

coveralls commented Apr 11, 2026

Coverage Report for CI Build 24290576706

Coverage increased (+0.01%) to 85.481%

Details

  • Coverage increased (+0.01%) from the base build.
  • Patch coverage: 13 of 13 lines across 3 files are fully covered (100%).
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 14215
Covered Lines: 11997
Line Coverage: 84.4%
Relevant Branches: 2163
Covered Branches: 2003
Branch Coverage: 92.6%
Branches in Coverage %: Yes
Coverage Strength: 1.76 hits per line

💛 - Coveralls

@HebaruSan HebaruSan force-pushed the fix/stability-override-change branch from 2e9ab55 to 56be05a Compare April 11, 2026 19:54
@HebaruSan HebaruSan force-pushed the fix/stability-override-change branch from 56be05a to 41e9087 Compare April 11, 2026 20:08
@HebaruSan HebaruSan merged commit 06b232c into KSP-CKAN:master Apr 11, 2026
12 checks passed
@HebaruSan HebaruSan deleted the fix/stability-override-change branch April 11, 2026 20:16
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants