Repository navigation
fix(dmm-import): stop treating unknown mods as already managed - #424
Merged
Merged
Conversation
Since the startup sha256 backfill (#296), every unknown VPK gets a metadata row with a hash, and enrich adds an inferred lockerHero to hero skins. The DMM import counted any hashed row as managed and any lockerHero as owned, so on a shared addons folder it skipped nearly every DMM mod and never adopted a hero skin. Add hasModIdentity() in metadata.ts (GameBanana id, name, a Grimoire-built VPK or a user choice such as a manual hero) and use it for both checks. When DMM's file sits outside Grimoire's folders but Grimoire already lists the same bytes as an unknown mod, tag that file instead of copying a duplicate.
Contributor
|
@Slush97 Should be fixed now, worked fine in my tests. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
The DMM import that runs as the first step of Fix Unknown has quietly done almost nothing since #296 (2026-07-24) on the default DMM setup, where DMM shares
citadel/addonswith Grimoire.backfillMissingMetadataHashes) gives every unknown VPK a metadata row with itssha256, and enrich addsglobalTypeand, for hero skins, an inferredlockerHero.migrateDmmInstallput every row with asha256intomanagedHashes, so DMM's own files were skipped as "an identical file is already managed by Grimoire".isGrimoireManagedcounted anylockerHero, so hero skins would be refused even once the hash check was fixed.Fix
hasModIdentity(meta)inmetadata.ts: a row counts as managed only if it has a GameBanana id, a name, a Grimoire-built VPK (merged, Locker builds, soul/urn imports, sound swaps, forge installs) or a user choice (manual hero, local variant group, priority mod). Hashes and inferred hero/global type do not count.dmmMigration.tsuses it for the "already managed" hash set and for the in-place ownership check (replacingisGrimoireManaged).@grimoire/social-types, IPC and i18n are untouched.Testing
dmmMigration.guards.test.ts) seed the rows startup actually writes. Two of them fail onmain; the manual-hero one checks protection is kept.tsc -b, eslint, vitest (2651 passed), ui:check, i18n check and manifest check all pass.dmm-migrate:scan/executein a throwaway Grimoire:main: 1 adopted, 6 skipped, 6 left unknown.Known, not changed here
DMM 2.0 parks a downloaded-but-never-enabled mod as
<id>_<name>_dir.vpkin the addons root. This import copies it to.disabled(never moving DMM files), and Grimoire's scan then drops the identical.disabledcopy, so the root file ends up identified but listed as enabled. Same behavior as before #296; #417's importer handles this case by moving the file.Related: #417 replaces this flow with the interchange importer and has the same two checks in
importer.ts; it should reusehasModIdentityafter rebasing.