AvyAddons / AdiBags_Bound

Filters for BoE, BoA, and BoP categories in AdiBags.
https://www.curseforge.com/wow/addons/adibags-bound
MIT License
0 stars 2 forks source link

[BUG] tbl is nil in TooltipUtil.SurfaceArgs #5

Closed SpareSimian closed 1 year ago

SpareSimian commented 1 year ago

Description

Intermittent crash when depositing reagents to my bank.

It appears to happen here: https://github.com/tomrus88/BlizzardInterfaceCode/blob/master/Interface/SharedXML/Tooltip/TooltipUtil.lua#L8

I'll add some debug prints to the addon to see if I can narrow down which table is nil.

I haven't yet seen it fail with only AdiBags loaded but I did test it that way. It's intermittent so I'll try to find it myself. I'm guessing another addon is leaving the tooltip with text in an unexpected format.

Addon Version

v1.6.2

World of Warcraft Flavor

Retail (Dragonflight)

Tested with only AdiBags_Bound

Lua Error

Message: Interface/SharedXML/Tooltip/TooltipUtil.lua:8: attempt to index local 'tbl' (a nil value) Time: Sat Mar 18 07:17:58 2023 Count: 52 Stack: Interface/SharedXML/Tooltip/TooltipUtil.lua:8: attempt to index local 'tbl' (a nil value)

[string "@Interface/AddOns/AdiBags/core/Filters.lua"]:146: in function Filter' [string "@Interface/AddOns/AdiBags/widgets/ContainerFrame.lua"]:849: in functionFilterSlot' [string "@Interface/AddOns/AdiBags/widgets/ContainerFrame.lua"]:883: in function DispatchItem' [string "@Interface/AddOns/AdiBags/widgets/ContainerFrame.lua"]:1052: in functionRedispatchAllItems' [string "@Interface/AddOns/AdiBags/widgets/ContainerFrame.lua"]:1211: in function <Interface/AddOns/AdiBags/widgets/ContainerFrame.lua:1194> [string "@Interface/AddOns/AdiBags/libs/CallbackHandler-1.0/CallbackHandler-1.0.lua"]:119: in function <...ags/libs/CallbackHandler-1.0/CallbackHandler-1.0.lua:119>

[string "@Interface/AddOns/AdiBags/libs/CallbackHandler-1.0/CallbackHandler-1.0.lua"]:19: in function <...ags/libs/CallbackHandler-1.0/CallbackHandler-1.0.lua:15> [string "@Interface/AddOns/AdiBags/libs/CallbackHandler-1.0/CallbackHandler-1.0.lua"]:54: in function SendMessage' [string "@Interface/AddOns/AdiBags/core/Core.lua"]:476: in function?' [string "@Interface/AddOns/AdiBags/libs/CallbackHandler-1.0/CallbackHandler-1.0.lua"]:109: in function <...ags/libs/CallbackHandler-1.0/CallbackHandler-1.0.lua:109>

[string "@Interface/AddOns/AdiBags/libs/CallbackHandler-1.0/CallbackHandler-1.0.lua"]:19: in function <...ags/libs/CallbackHandler-1.0/CallbackHandler-1.0.lua:15> [string "@Interface/AddOns/AdiBags/libs/CallbackHandler-1.0/CallbackHandler-1.0.lua"]:54: in function <...ags/libs/CallbackHandler-1.0/CallbackHandler-1.0.lua:49>

Locals:

Reproduction Steps

Hit the "D" button to transfer reagents to one's bank.

Screenshots

No response

lucasvienna commented 1 year ago

Thanks for the report, I'll see if I can reproduce locally as well. Haven't seen this yet, but I don't really use that button. Intermittent bugs are the most annoying to debug 😅

SpareSimian commented 1 year ago

My initial patch tests for the null table before invoking SurfaceArgs, prints a message, and returns nil. Alas, I was too busy playing to notice any message if it occurred, but I didn't see any more crashes after that.

I don't think the Deposit button is the only cause, as I noticed when alt-tabbing back into the game to post the bug report that I was standing at a vendor, so I think it also happened when vendoring junk, perhaps when I opened my bags. I'll remove the "return nil" to force a crash so I'll notice it when it happens again.

Candidate add-ons that might be triggering the issue are Altoholic and Auctioneer, both of which patch the tooltip with information.

lucasvienna commented 1 year ago

I haven't seen it happen yet, my debug logs are never showing nil tables. The only addon you've mentioned that is an outlier here is Auctioneer. I run Altoholic as well, and so far, I haven't got any errors on that front.

SpareSimian commented 1 year ago

I just hearthed to Oribos and had it happen on zoning in. Scanner is nil for all bags, but not all slots. I don't see a pattern in which slots are failing. I don't think it's empty or junk slots. But I'm only logging the failed bank/slot index and it's hard to know which item is which in the bag view, so I'll add some more logging.

jkemouse11 commented 1 year ago

This happened for me again today right after I hearthed to Valdrakken. I had DISABLED AdiBags Bound v1.6.3 a few days ago so currently I have installed:

AdiBags v1.10.7 AdiBags - Dragonflight (includes Crafting) v2.2.5 AdiBags - Low Level (Dragonflight Compatible) v1.0.1 AdiBags - Primordial Stones v1.0

If you are willing to teach me to debug it, I can run tests/logging.

411x SharedXML/Tooltip/TooltipUtil.lua:8: attempt to index local 'tbl' (a nil value)

[string "@AdiBags/core/Filters.lua"]:146: in function Filter' [string "@AdiBags/widgets/ContainerFrame.lua"]:849: in functionFilterSlot' [string "@AdiBags/widgets/ContainerFrame.lua"]:883: in function DispatchItem' [string "@AdiBags/widgets/ContainerFrame.lua"]:1052: in functionRedispatchAllItems' [string "@AdiBags/widgets/ContainerFrame.lua"]:1211: in function <AdiBags/widgets/ContainerFrame.lua:1194> [string "@AdiBags/libs/CallbackHandler-1.0-8/CallbackHandler-1.0.lua"]:119: in function <...ags/libs/CallbackHandler-1.0/CallbackHandler-1.0.lua:119>

[string "@AdiBags/libs/CallbackHandler-1.0-8/CallbackHandler-1.0.lua"]:19: in function <...ags/libs/CallbackHandler-1.0/CallbackHandler-1.0.lua:15> [string "@AdiBags/libs/CallbackHandler-1.0-8/CallbackHandler-1.0.lua"]:54: in function SendMessage' [string "@AdiBags/core/Core.lua"]:476: in function?' [string "@AdiBags/libs/CallbackHandler-1.0-8/CallbackHandler-1.0.lua"]:109: in function <...ags/libs/CallbackHandler-1.0/CallbackHandler-1.0.lua:109>

[string "@AdiBags/libs/CallbackHandler-1.0-8/CallbackHandler-1.0.lua"]:19: in function <...ags/libs/CallbackHandler-1.0/CallbackHandler-1.0.lua:15> [string "@AdiBags/libs/CallbackHandler-1.0-8/CallbackHandler-1.0.lua"]:54: in function <...ags/libs/CallbackHandler-1.0/CallbackHandler-1.0.lua:49>

SpareSimian commented 1 year ago

Twice now I've had this happen when hitting the D button to transfer to my reagent bank, and my logging showed it was all the occupied slots in bag 5, which I believe is the reagent bag. So perhaps GetContainerItemLink intermittently fails in that situation. I know that some reagents can be soulbound so that's certainly not an ideal situation for this addon.

lucasvienna commented 1 year ago

I can add a nil check before calling this util function and see if that stems the errors.

SpareSimian commented 1 year ago

I do wonder why that function is failing just for the reagent bag, and intermittently. Blizzard bug? (That wouldn't surprise me.)

lucasvienna commented 1 year ago

Bit of an update here: the 10.1 release changed the tooltips API again, and this time around we no longer need to call TooltipUtil.SurfaceArgs()

The C_TooltipInfo APIs now return data with all data and line arguments surfaced, removing the need to call TooltipUtil.SurfaceArgs().

This bug should no longer happen. If nothing else, due to the fact that I no longer call that function in this addon :)

You can see the changes here: https://github.com/AvyAddons/AdiBags_Bound/commit/1501041baf2893b188cbddc62eb736599c46a832#diff-209efd129f4861c4ea46d5eefc33f539d4378467f7f840f46cff1a550fc4e01bL248

SpareSimian commented 1 year ago

I'd be fine with closing it, then. Thanks for letting me know. (Also, I didn't know addons could use icons for the addon list. I just added one to mine. Thanks!)