code
code copied to clipboard
Fix updating mod version if file hash is the same
Cause:
- Dynamic Lights has the following versions:
-
Ag9747skfor Forge with file hashf02d2bcb995ee5531555995d6625571bc7f3518fa3f5e45bba230d08cd89a608 -
Yyh6uR59for Forge + NF with file hashf02d2bcb995ee5531555995d6625571bc7f3518fa3f5e45bba230d08cd89a608 - Two versions, but the file hashes are the same
-
- User downloads Dynamic Lights version Ag9747sk, downloading the f02d… file hash
- When we scan the instance mods directory to see what mods are installed, we find f02d…
- We ask the backend to see what version this file hash corresponds to - it tells us Yyuh6uR59
- We ask the backend to see what updates are available - Ag9747sk is available
- Therefore, we always update to the "new version", but it's actually the same version, and app gets confused
Solution:
- When app requests version info for a file hash, return all versions associated with it, not just the last one
inserted into the map - When setting the
update_version_id, iterate through all versions, not just the first one wefind()