Bagnon

Bagnon

122M Downloads

Clean items infinite loop

Jokaleth opened this issue · 34 comments

commented

Running Software (issues missing this information will be deleted):

  • Addon version: 9.1.1-2.5.1
  • Server patch: 2.5.2

Have you read the changelog? (please don't waste our time)
Yes

Describe the bug
Item sorting using the clean items button gets stuck in an infinite loop causing lag.

To Reproduce
Steps to reproduce the behaviour:

  1. Open bags
  2. Click clean items button
  3. Infinite loop

Expected behaviour
Items are sorted quickly in the bags.

Screenshots
https://user-images.githubusercontent.com/87456827/134192835-5acd8a6f-2860-4b53-bda4-e5e7f155d4ee.mp4

Additional context
I know multiple other people have also reported this issue but I didn't see any of them mentioning that this bug is only happening to profession-specific items such as Skinning Knife, Leather, etc. Whatever was updated in the 9.1.1 version, "TBC: Fixed profession items sorting issue." actually had the opposite effect,

commented

Same issue when I try to auto-sort my bags after updating to 9.1.1 on TBC. I believe the motes are causing it, as it looks like they are highlighted when the loop gets stuck. See screenshot for an overview of the items I have in my bag.
EDIT: To clarify, I only have normal bags. No profession bags or anything special.
EDIT2: I tried to put all motes, as well as Primal Life, Primal Nether, and rune threads, into bank and sort again. It still got stuck.
image

commented

It's a bit hard to tell which item is causing that loop, but my guess its the leather. Could you try putting the leather in the bank and see if it persists?
To double check, this is TBC server, correct?

Hi, sorry for delayed response, been out of the house. Unfortunately won't be back for a few more hours so I can't do any more testing. Ignore the close/reopen, I just hit the wrong button.
Yes this is TBC server.
I have 3 normal bags and 1 Gun Ammo bag. However this problem still happened when I took the Gun Ammo bag off and only had 3 normal bags as well.
The problem only happens with the profession items, (the ones flashing gray) in the video I sent that would be: the Skinning Knife, Leathers/Scales, Patterns, Heavy Armor Kit, and, oddly, Silk Cloth (but not the Wool or Mageweave). When I took all profession items out of my inventory before it sorted the remaining items with no problem.

commented

It's a bit hard to tell which item is causing that loop, but my guess its the leather. Could you try putting the leather in the bank and see if it persists?
To double check, this is TBC server, correct?

commented

You also do not appear to be using any leatherwoking bag. Is that an ammo pouch and a keyring, besides the normal bags?

commented

You also do not appear to be using any leatherwoking bag. Is that an ammo pouch and a keyring, besides the normal bags?

I'm having same issue and skinning knife seems to be the culprit

commented

Removed skinning knife => same
Removed drums => same
Remove a few motes => Fixed

So seems the issue could be related to anything that could fit in a profession bag.

I have 0 profession bag, just normal ones
@Jaliborc

commented

Tested with skinning knife and ammo bags. No issue. Can't replicate.

commented

I have been having the exact same issue after updating bagnon this morning. As a hunter on TBC the thing that has been causing it for me is arrows in my quiver.

commented

Same issue with the motes looks like the problem is with this change (Jaliborc/Wildpants@1d1f8d5#diff-7fb9d196a5cc0ff9ca2e4030accf44f74909a0ebeb0b31507bce5126e368a27c)

commented

I have been having the exact same issue after updating bagnon this morning. As a hunter on TBC the thing that has been causing it for me is arrows in my quiver.

That's interesting because I haven't had any problems with the Bullet ammo.

commented

I have been having the exact same issue after updating bagnon

image

commented

I have the same issue with the loop, it hangs on "Runic Spell Thread"
Error message: This item cannot fit into the container.

commented

I am having the same infinite loop I highlighted the objects that are looping:

BagLoop

commented

Same issue. Also hightlighted the item which is in the sorting loop
grafik

commented

image
For me its looping the motes of fire and earth.

commented

This is still happening for me. No special bags. Skinning knife, mote of mana, and knothide leather were all items it got stuck on (same as the previous patch)

commented

Having the same issue with 9.1.2 with no profession bags equipped.

For me it's only when I have any Motes/Primals/Primal Nether/Primal Might in my bags.

But sorting in the bank works fine even with Motes/Primals/Primal Nether/Primal Might present.

image

commented
commented

Updated Bagnon to 9.1.2-2.5.1 and the same issue is still happening.

Judging from the items that remain shaded in the bag screenshot below, the problem seems to be related to motes and essences.
2021-09-23

commented

It seems like this is an issue related to this commit in the Wildpants library. Reverting the change fixes the bug.

commented

It seems like this is an issue related to this commit in the Wildpants library. Reverting the change fixes the bug.

Can confirm this fixed issue for me.

commented

Can confirm this fixed issue for me.

It does fix the looping issue with sorting, but it prevents the items from going in the profession bags which was the intent of the change. It's nice to have a workaround while it's addressed.

commented

Still here for me with 9.1.2

image

commented

Its not only for motes, I got this error with several materials in my bags, i.e.: I get this error sorting inventory bags with essence of fire, but nothing happened if same essence are in bank bags.

Its seem that bug is in sort function, please make some extended tests before release.

as wrote in #1323 (comment)

commented

Can confirm this fixed issue for me.

It does fix the looping issue with sorting, but it prevents the items from going in the profession bags which was the intent of the change. It's nice to have a workaround while it's addressed.

So I think this is the root of the issue. When returning Sort:FitsIn I believe the addon needs to use ContainerIDToInventoryID(1) through ContainerIDToInventoryID(4) to make sure that one of the bags is actually equipped. The sort feature appears to be stuck in a loop of moving the items into a container that is not equipped.

commented

I was able to fix the issue by downloading a previous version of bagnon and replacing the files. Specifically version 9.1.0 https://www.curseforge.com/wow/addons/bagnon/download/3371569
You can find the file location for your addons by clicking the options button
image
The file path should be something like E:\World of Warcraft_classic_\Interface\AddOns
So download 9.1.0 then extract to the addons folder and replace all bagnon files. Sort works great again.

commented

Same problem for me🤔

commented

@Jaliborc could you kindly push the Bagnon update 2 versions back which doesn't have the sort feature bug until this is resolved? I(we)'ve been unable to sort our bag properly since then and rely on the addon. Hope I am not asking for too much. Thank you

commented

@Jaliborc From what I've been able to determine, it seems that it's trying to swap anything where the 4th itemFamily bit (eligible for the Leatherworking bag) is 1 with something in the keyring. Primals/Motes/Essences are a niche case since they can go into so many different profession bags and it's not consistent between the different types. E.G. Primal Life can go in Leatherworking, Herbalism, and Enchanting bags while Primal Fire can go in Leatherworking, Enchanting, Engineering, and Mining bags.

I'm pretty sure that this is because bit.band(GetItemFamily(id), family) passes passes because your family value for the keyring is 9 => 1001. So FitsIn() passes when you try to put "leather" in the keyring.

TBC-Classic
Bagnon-9.1.2-2.5.1
All normal bags

I used this macro in-game and the common problem items all had the 4th bit as 1 when converted to binary.
/run for b =0,5 do for s=1,GetContainerNumSlots(b) do local id = GetContainerItemID(b, s); if id ~= nil then n = {GetItemInfo(id)}; print(n[1] .. " " .. n[6] .. " " .. n[7] .. " " .. GetItemFamily(id)); end end end

This can probably be confirmed if everyone tests it with this macro and removes anything that pops up. If the issues persist but this macro doesn't print anything, something else is the cause.
/run for b =0,5 do for s=1,GetContainerNumSlots(b) do local id = GetContainerItemID(b, s); if id ~= nil then local f = GetItemFamily(id); if bit.band(8,f) > 0 then local n, _ = GetItemInfo(id); if n ~= nil then print(n) end end end end end

commented

Ok, if we know keyring bag has 9 as family and no other ever type of bag has 9, let's make this a special case.

I already see we have:

(family == 9 and GetItemFamily(id) == 256) or

which I presume tests for keys.

If that is the case, then family 9 should be forcibly excluded from the part that uses bit.band preventing items that might have that bit set to 'jump' in a keyring bag.

commented

If that is the case, then family 9 should be forcibly excluded from the part that uses bit.band preventing items that might have that bit set to 'jump' in a keyring bag.

Since 9 represents the bits that is on for keys, which gets the 256 dec value, I think there are two better options here, both include removing (family == 9 and GetItemFamily(id) == 256) from sorting.lua::FitsIn()

  • Go through and change the container.family value to be GetItemFamily(<itemID of bag equipped>) and check bit.band(GetItemFamily(id), family)
  • Change the bit.band() call to (bit.band(GetItemFamily(id), 2^(family-1)) > 0

The second one stops the "Item doesn't go into that container" infinite loop for me with Primals, Motes, Light Feathers, and Leather in my bags, but I don't have any profession bags or quivers. Also, another condition in FitsIn() will have to be added for when family == -3 for the Retail Reagent bank.

commented

Been having this infinite loop issue since the latest update. Specifically it's with the arrows in my quiver (i'm a hunter). The Warden's Arrows and Adamantite Stingers flash infinitely until i reload.

commented

I am still having problems with this add on. Please fix.

commented

I know the following items definitely cause this for me: Drums of Battle (with some used charges), light feathers, and skinning knife (similar to other people's reports). For me, Bagnon updates are managed via the Curseforge app and Bagnon is at version 9.1.2-2.5.1.zip. My bags are the Onyxia Hide Backpack and 3 Imbued Netherweave Bags.