Skip to content

Improve mod update check accuracy#2385

Open
Al12rs wants to merge 11 commits intomasterfrom
al/mod-update-check-refactor
Open

Improve mod update check accuracy#2385
Al12rs wants to merge 11 commits intomasterfrom
al/mod-update-check-refactor

Conversation

@Al12rs
Copy link
Copy Markdown
Member

@Al12rs Al12rs commented May 1, 2026

Refactor mod update check

Reworks nxmUpdatesAvailable for clarity, performance, and correctness, and
fixes a long-standing bug in the install merge flag along the way.

Behavior changes

  • Update check now resolves the installed file by recorded Nexus file_id
    first, falling back to filename if not present.
  • updateAvailable() short-circuit now flags any obsolete status (OLD,
    REMOVED, ARCHIVED, ARCHIVED_HIDDEN), not just OLD/REMOVED.
  • Obsolete files with no active successor will surface the latest
    downloadable inactive successor (skipping REMOVED) instead of falling
    back to a separate mod-info call.
  • The requestModInfo follow-up is now only triggered when the mod has no
    identifiable installation file at all (manually-assigned mod_id).
  • setLastNexusUpdate now fires for every mod processed.

Bug fix

  • InstallationManager::doInstall had a dead bool merge = false that was
    never wired to result.merged(), causing every install (including merge
    installs) to clear installedFiles on disk. Fixed.

Internal changes

  • ModInfoRegular::m_InstalledFileIDs switched from std::set to
    std::vector so install order is preserved (most recent install last).
    Public installedFiles() API still returns std::set for to not break plugin API.
  • New ModInfoRegular::nexusFileId() accessor returns the file_id of the
    most recent install.
  • Update check uses filesById and updatesByOldId hash indexes replacing nested linear scans.
  • Split up the long function out into some methods for redability.

Update check behaviour:

Scenario Status badge Tooltip "newest version" Update indicator
Active file installed, no newer version in chain none matches installed (own version) no
Active file, active successor in chain none successor's version yes (via version)
Obsolete file (OLD/REMOVED/ARCHIVED) listed, active successor in chain obsolete successor's version yes (via status + version)
Obsolete file listed, only inactive non-removed successors in chain obsolete latest downloadable successor's version yes (via status + version)
Obsolete file listed, no usable successor (only REMOVED ones, or none) obsolete own version yes (via status)
Installed file no longer in listing (archived & hidden by author) — successor in chain hidden successor's version yes (via status + version)
Installed file no longer in listing — no chain to walk hidden unchanged from prior check yes (via status)
Manually-created mod with mod_id assigned via edit interface (no install file) unchanged mod-page global version (via follow-up call) yes if mod-page version > installed

Comment thread src/mainwindow.cpp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants