ogri-la / strongbox

a World of Warcraft Addon Manager aimed at Linux players
GNU Affero General Public License v3.0
169 stars 7 forks source link

"Ignore" not working properly #433

Closed akanouras closed 2 months ago

akanouras commented 3 months ago

Every time I update an addon by hand, if an older version of it exists in some other repo, StrongBox immediately starts considering the older version as an available update for it.

To Reproduce

  1. Download Details or RareScanner from Curse
  2. Use "Install addon from file". Alternatively, unpack it manually and Refresh (F5)
  3. Strongbox will detect the newer version having been installed
  4. Strongbox wll forget that I've previously asked it to "Ignore" the addon. "Pin Release" will also be forgotten, but that's to be expected I guess
  5. Strongbox will mark the (way) older version of the addon found in WoWInterface to be installed on next "Update all"

Expected behavior I expect it to not touch the addon under any circumstance.

Additional context This has been happening with all versions of Strongbox since Curse support had been removed, including 7.4.0.

torkus commented 3 months ago

hey @akanouras , thanks for opening a ticket.

It sounds like the metadata strongbox stores about an addon is being destroyed when you manually install it. This metadata is stored in /path/to/addon/dir/SomeAddon/.strongbox.json and looks something like this:

{"group-id":"https://www.wowinterface.com/downloads/info19037",
 "installed-version":"0.91",
 "name":"archaeology-helper",
 "source":"wowinterface",
 "installed-game-track":"retail",
 "ignore?":true,
 "pinned-version":"0.91",
 "source-id":19037,
 "source-map-list":[{"source":"wowinterface", "source-id":19037}],
 "primary?":true}

This metadata is created and updated when an addon is installed through strongbox.

This decision to store addon information in the addon directory was inherited from wowmatrix believe it or not, as strongbox (then 'wowman') was created as a replacement to wowmatrix. That decision hasn't aged too well. It's robust in some scenarios but a move to centralised state management would solve this and other niggling problems we're having.

Use "Install addon from file".

It seems reasonable that if strongbox provides a way to manually install an addon, that this metadata will be preserved, including any ignore and pin flags. I'll look into that.

If you manually unzip the addon and it somehow destroys the metadata then it seems reasonable that strongbox will detect a new addon and try to match it against the catalogue, in this case detecting a match against a much older version from the wowinterface catalogue. Can't help you in this scenario until strongbox moves to centralised state management.

akanouras commented 3 months ago

Thank you for all your work, and the fast response!

I'd noticed that addon information was being stored in the addon directory, and it was helpful for those situations where I copied addons from a PC to another. But it needs more complex handling in this case, indeed. :-/

torkus commented 2 months ago

Thank you for all your work, and the fast response!

Ho ho - not so fast now, am I? I'm more tortoise than hare ...

Sorry for the delay. The new feature has just been released as part of Strongbox 7.5.0.

I found a few significant bugs in this area (you can read about them in the CHANGELOG) but the good news is that installing an addon from a file should now bypass the ignore flag on an addon.

However, if an addon is pinned to a specific version and installing an addon from a file overwrites that pinned addon, it will become unpinned.

I think there is room for improvement and better configuration in this behaviour, but for now I thought I'd just get it out there.

Thanks for opening a ticket and if you feel it's not quite right or could be improved please open another ticket.