Errors on ReloadUI()
Talyrius opened this issue · 11 comments
I receive the following two errors upon reloading my UI. Occasionally, they don't occur, but that is rare. Whether or not they occur appears completely random. In addition to the error, an empty ArtifactFrame
is shown.
4x ...ras\libs\LibArtifactData-1.0\LibArtifactData-1.0-5.lua:199: 'for' limit must be a number
...ras\libs\LibArtifactData-1.0\LibArtifactData-1.0-5.lua:199: in function <...ras\libs\LibArtifactData-1.0\LibArtifactData-1.0.lua:197>
...ras\libs\LibArtifactData-1.0\LibArtifactData-1.0-5.lua:328: in function '?'
...ras\libs\LibArtifactData-1.0\LibArtifactData-1.0-5.lua:67: in function <...ras\libs\LibArtifactData-1.0\LibArtifactData-1.0.lua:67>
Locals:
artifactID = nil
relics = <table> {
}
(for index) = 1
(for limit) = nil
(for step) = 1
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = "'for' limit must be a number"
GetNumRelicSlots = <function> defined =[C]:-1
GetRelicSlotType = <function> defined =[C]:-1
GetRelicInfo = <function> defined =[C]:-1
strmatch = <function> defined =[C]:-1
artifacts = <table> {
knowledgeMultiplier = 1
128819 = <table> {
}
knowledgeLevel = 0
}
5x ...eBlizzard_ArtifactUI\Blizzard_ArtifactUI.lua:41: attempt to compare number with nil
...eBlizzard_ArtifactUI\Blizzard_ArtifactUI.lua:41: in function 'ArtifactUI_CanViewArtifact'
...ddOns\Blizzard_ArtifactUI\Blizzard_ArtifactPerks.lua:680: in function 'EvaluateRelics'
...ddOns\Blizzard_ArtifactUI\Blizzard_ArtifactPerks.lua:541: in function <...ddOns\Blizzard_ArtifactUI\Blizzard_ArtifactPerks.lua:539>
[C]: in function 'SetShown'
...eBlizzard_ArtifactUI\Blizzard_ArtifactUI.lua:172: in function 'SetTab'
...eBlizzard_ArtifactUI\Blizzard_ArtifactUI.lua:138: in function 'EvaulateForgeState'
...eBlizzard_ArtifactUI\Blizzard_ArtifactUI.lua:70: in function <...eBlizzard_ArtifactUI\Blizzard_ArtifactUI.lua:67>
[C]: in function 'Show'
FrameXML\UIParent.lua:2336: in function 'SetUIPanel'
FrameXML\UIParent.lua:2154: in function 'ShowUIPanel'
FrameXML\UIParent.lua:2048: in function <FrameXML\UIParent.lua:2044>
[C]: in function 'SetAttribute'
FrameXML\UIParent.lua:2830: in function 'ShowUIPanel'
FrameXML\UIParent.lua:1466: in function <FrameXML\UIParent.lua:891>
[C]: ?
Locals:
(*temporary) = nil
(*temporary) = false
(*temporary) = "attempt to compare number with nil"
Sadly, I can't reproduce this. Are you still getting the errors? Do you have other addons that do artifact related stuff? Which addon is LibArtiactData embedded into?
It's embedded in AdiButtonAuras. There aren't any others.
I can't reproduce the errors consistently either. I disabled all the addons I have that call Artifact related functions and I still received them intermittently upon reloading my UI. However, I don't receive them with just AdiButtonAuras enabled.
I have the same problem. I run a lot of addons including AdiButtonAura. If I disable AdiButtonAura the problem goes away.
The problem seems to be related to row 196 in LibArtifactData-1.0.lua
for i = 1, GetNumRelicSlots() do
If I do
/dump _G.C_ArtifactUI.GetNumRelicSlots()
I get "empty result" which is not a valid upper bound.
Edit:
I found a workaround that seems to be working for me. Dunno if I broke something else. Added a nil check to the following function:
function private.ARTIFACT_UPDATE(event, newItem)
if viewedID == nil then
return
end
Edit2:
After more testing the above did not resolve the problem
Can you reproduce this by running only ABA?
On Fri, Sep 9, 2016, 23:17 Linus Sunde [email protected] wrote:
I have the same problem. I run a lot of addons including AdiButtonAura. If
I disable AdiButtonAura the problem goes away.The problem seems to be related to row 196 in LibArtifactData-1.0.lua
for i = 1, GetNumRelicSlots() do
If I do
/dump _G.C_ArtifactUI.GetNumRelicSlots()
I get "empty result" which is not a valid upper bound.—
You are receiving this because you commented.Reply to this email directly, view it on GitHub
#4 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAWNZLQ_X_XDCVdAer9rydIHXW1I6Jxgks5qoczygaJpZM4Jyqgf
.
I did not manage to single out an addon causing the problem. The risk of the problem occuring seems to increase with the number of addons enabled.
I end up with two errors:
92x ...eBlizzard_ArtifactUI\Blizzard_ArtifactUI.lua:41: attempt to compare number with nil
...eBlizzard_ArtifactUI\Blizzard_ArtifactUI.lua:41: in function `ArtifactUI_CanViewArtifact'
...ddOns\Blizzard_ArtifactUI\Blizzard_ArtifactPerks.lua:680: in function `EvaluateRelics'
...ddOns\Blizzard_ArtifactUI\Blizzard_ArtifactPerks.lua:541: in function <...ddOns\Blizzard_ArtifactUI\Blizzard_ArtifactPerks.lua:539>
[C]: in function `SetShown'
...eBlizzard_ArtifactUI\Blizzard_ArtifactUI.lua:172: in function `SetTab'
...eBlizzard_ArtifactUI\Blizzard_ArtifactUI.lua:138: in function `EvaulateForgeState'
...eBlizzard_ArtifactUI\Blizzard_ArtifactUI.lua:70: in function <...eBlizzard_ArtifactUI\Blizzard_ArtifactUI.lua:67>
[C]: in function `Show'
FrameXML\UIParent.lua:2336: in function `SetUIPanel'
FrameXML\UIParent.lua:2154: in function `ShowUIPanel'
FrameXML\UIParent.lua:2048: in function <FrameXML\UIParent.lua:2044>
[C]: in function `SetAttribute'
FrameXML\UIParent.lua:2830: in function <FrameXML\UIParent.lua:2818>
[C]: in function `ShowUIPanel'
FrameXML\UIParent.lua:1466: in function <FrameXML\UIParent.lua:891>
Locals:
(*temporary) = nil
(*temporary) = false
(*temporary) = "attempt to compare number with nil"
70x ...ras\libs\LibArtifactData-1.0\LibArtifactData-1.0-5.lua:199: 'for' limit must be a number
...ras\libs\LibArtifactData-1.0\LibArtifactData-1.0-5.lua:199: in function <...ras\libs\LibArtifactData-1.0\LibArtifactData-1.0.lua:197>
...ras\libs\LibArtifactData-1.0\LibArtifactData-1.0-5.lua:331: in function `?'
...ras\libs\LibArtifactData-1.0\LibArtifactData-1.0-5.lua:67: in function <...ras\libs\LibArtifactData-1.0\LibArtifactData-1.0.lua:67>
Locals:
artifactID = nil
relics = <table> {
}
(for index) = 1
(for limit) = nil
(for step) = 1
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = "'for' limit must be a number"
GetNumRelicSlots = <function> defined =[C]:-1
GetRelicSlotType = <function> defined =[C]:-1
GetRelicInfo = <function> defined =[C]:-1
strmatch = <function> defined =[C]:-1
artifacts = <table> {
128306 = <table> {
}
128821 = <table> {
}
128860 = <table> {
}
knowledgeLevel = 1
knowledgeMultiplier = 1.25
128858 = <table> {
}
}
The first error seems to happen in blizzard code Blizzard_ArtifactUI.lua line 41. After the error occuring running /dump C_ArtifactUI.GetTotalPurchasedRanks()
prints "empty result" which explains why line 41 crashes, but not why "empty result" is printed.
Edit: Seems like C_ArtifactUI.GetTotalPurchasedRanks()
is supposed to return nil
if the artifact window is closed. Could it be some race condition with the window caused by slowdowns with multiple addons?
Might actually be a race condition. I found the following:
function private.PLAYER_ENTERING_WORLD(event)
_G.C_Timer.After(5, function()
InitializeScan(event)
frame:RegisterEvent("PLAYER_EQUIPMENT_CHANGED")
frame:RegisterEvent("CURRENCY_DISPLAY_UPDATE")
end)
end
After upping that 5 to a 10 I haven't had the problem occur again. Maybe there's a more rigorous way to schedule the first scan than using a delay?
Edit: Didn't solve all problems. It removed the problem at startup but later on when I gained artifact power I got the following error:
1x ...ras\libs\LibArtifactData-1.0\LibArtifactData-1.0-5.lua:354: attempt to index local 'artifact' (a nil value)
...ras\libs\LibArtifactData-1.0\LibArtifactData-1.0-5.lua:354: in function `?'
...ras\libs\LibArtifactData-1.0\LibArtifactData-1.0-5.lua:67: in function <...ras\libs\LibArtifactData-1.0\LibArtifactData-1.0.lua:67>
Locals:
While I really appreciate your efforts, you are running an old version of LAD. If you are using the curse client, set the release type to alpha and update. If you are installing manually, install from wowace.com instead of from curse.com
The delay for the initial scan is because I rely on the return value of C_ArtifactUI.GetNumObtainedArtifacts()
to know how many artifacts the player has. However it seems that this does not return correct values immediately after cold login and there is no specific event associated with it.
C_ArtifactUI.GetNumRelicSlots()
also returns data only when the ArtifactFrame is open. I can safely change that to 3, but then it will error on GetRelicSlotType(), so this is not a solution too.
A wild guess on my side is that when ARTIFACT_UPDATE is fired, all listeners for that event are queued for execution. However if someone uses C_ArtifactUI.Clear() or sockets a new item, then the artifact data becomes unavailable and most of the artifact API returns nils, so that the listeners that are still in the execution queue won't get the data.
LAD has one nil guard in GetViewedArtifactData
to account for that and one in the event listener for ARTIFACT_XP_UPDATE
(in case it failed to get data for the given artifact). LAD also unregisters ARTIFACT_UPDATE from the default UI before socketing the artifacts, so it shouldn't lead to the reported problems with it.
I don't know what else I can do about that.
Well, all this means, that while I could prevent the errors from showing, I can't rely on the artifact data being obtainable and thus I can't assert that LAD has up-to-date artifact data or any data at all.
I guess this is only fixable by Blizzard.
Suppressing the errors would be valuable. We could use a quiet error state to try to grab data again later.