code icon indicating copy to clipboard operation
code copied to clipboard

Fix updating mod version if file hash is the same

Open aecsocket opened this issue 3 days ago • 0 comments

Cause:

  • Dynamic Lights has the following versions:
    • Ag9747sk for Forge with file hash f02d2bcb995ee5531555995d6625571bc7f3518fa3f5e45bba230d08cd89a608
    • Yyh6uR59 for Forge + NF with file hash f02d2bcb995ee5531555995d6625571bc7f3518fa3f5e45bba230d08cd89a608
    • 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 we find()

aecsocket avatar Jan 16 '26 12:01 aecsocket