Aiue / AQT

Quest Tracking Addon for World of Warcraft
Other
2 stars 1 forks source link

Compatibility Issues with WideQuestLogLevels #68

Closed chkmyid closed 4 years ago

chkmyid commented 4 years ago

An error message occurs when I click on the header. When using the default setting of the click, "Show In Quest Log". There are two messages below. Would you like to see where the problem is? WideQuestLogLevels will not function normally after an error message appears. The tag will be missing and an error will be detected every time I look at the quest log. The problem does not occur with other trackers.

    {
        ["message"] = "...ace\\AddOns\\WideQuestLogLevels\\WideQuestLogLevels.lua:16: bad argument #3 to 'format' (string expected, got nil)",
        ["time"] = "2019/11/02 21:41:10",
        ["locals"] = "(*temporary) = \"  [%d] %s\"\n(*temporary) = 0\n(*temporary) = nil\n(*temporary) = \"string expected, got nil\"\n",
        ["stack"] = "[C]: in function `format'\n...ace\\AddOns\\WideQuestLogLevels\\WideQuestLogLevels.lua:16: in function <...ace\\AddOns\\WideQuestLogLevels\\WideQuestLogLevels.lua:1>\n[C]: ?",
        ["session"] = 212,
        ["counter"] = 246,
    }, -- [2]

    {
        ["message"] = "Interface\\FrameXML\\QuestLogFrame.lua:165: attempt to concatenate local 'questLogTitleText' (a nil value)",
        ["time"] = "2019/11/02 21:41:10",
        ["locals"] = "self = nil\nnumEntries = 19\nnumQuests = 10\nquestIndex = -3\nquestLogTitle = QuestLogTitle1 {\n 0 = <userdata>\n isHeader = true\n r = 0.700000\n Text = QuestLogTitle1NormalText {\n }\n g = 0.700000\n b = 0.700000\n}\nquestTitleTag = QuestLogTitle1Tag {\n 0 = <userdata>\n}\nquestNumGroupMates = QuestLogTitle1GroupMates {\n 0 = <userdata>\n}\nquestNormalText = QuestLogTitle1NormalText {\n 0 = <userdata>\n}\nquestHighlight = QuestLogTitle1Highlight {\n 0 = <userdata>\n}\nquestCheck = QuestLogTitle1Check {\n 0 = <userdata>\n}\nquestLogTitleText = nil\nlevel = 0\nquestTag = nil\nisHeader = false\nisCollapsed = false\nisComplete = nil\ncolor = nil\nnumPartyMembers = nil\npartyMembersOnQuest = nil\ntempWidth = nil\ntextWidth = nil\n(for index) = 1\n(for limit) = 23\n(for step) = 1\ni = 1\n(*temporary) = <function> defined =[C]:-1\n(*temporary) = QuestLogTitle1 {\n 0 = <userdata>\n isHeader = true\n r = 0.700000\n Text = QuestLogTitle1NormalText {\n }\n g = 0.700000\n b = 0.700000\n}\n(*temporary) = \"  \"\n(*temporary) = nil\n(*temporary) = false\n(*temporary) = nil\n(*temporary) = 1\n(*temporary) = 0\n(*temporary) = false\n(*temporary) = false\n(*temporary) = false\n(*temporary) = false\n(*temporary) = false\n(*temporary) = false\n(*temporary) = false\n(*temporary) = false\n(*temporary) = false\n(*temporary) = \"attempt to concatenate local 'questLogTitleText' (a nil value)\"\n",
        ["stack"] = "Interface\\FrameXML\\QuestLogFrame.lua:165: in function <Interface\\FrameXML\\QuestLogFrame.lua:111>\nInterface\\AddOns\\AQT\\Core.lua:51: in function <Interface\\AddOns\\AQT\\Core.lua:42>\nInterface\\AddOns\\AQT\\Core.lua:256: in function `func'\nInterface\\AddOns\\AQT\\GUI.lua:1074: in function <Interface\\AddOns\\AQT\\GUI.lua:992>",
        ["session"] = 212,
        ["counter"] = 88,
    }, -- [3]
Aiue commented 4 years ago

I'll take a look at it and see if I can add compatibility!

Aiue commented 4 years ago

Took a look at it. Not a compatibility issue. It's up to the author of WideQuestLogLevels to validate return values from the Blizzard API function GetQuestLogTitle(). It does happen in FrameXML/QuestLogFrame.lua as well, though. Which means I should take a look to see if any of the other QuestLogFrame related functions I use will call QuestLog_Update(), and if they do, also not call them if there are any nil returns from GetQuestLogTitle() to avoid blame for something out of my control.

chkmyid commented 4 years ago

A newer version has detected that this issue is still occurring.

1x AQT\QLU.lua:57: attempt to concatenate local 'questLogTitleText' (a nil value) AQT\QLU.lua:57: in function QuestLog_Update' AQT\Core.lua:257: in functionfunc' AQT\GUI.lua:1194: in function <AQT\GUI.lua:1112>

Locals: self = nil numEntries = 18 numQuests = 9 questIndex = -4 questLogTitle = QuestLogTitle1 { 0 = isHeader = true r = 0.700000 Text = QuestLogTitle1NormalText { } g = 0.700000 b = 0.700000 } questTitleTag = QuestLogTitle1Tag { 0 = } questNumGroupMates = QuestLogTitle1GroupMates { 0 = } questNormalText = QuestLogTitle1NormalText { 0 = } questHighlight = QuestLogTitle1Highlight { 0 = } questCheck = QuestLogTitle1Check { 0 = } questLogTitleText = nil level = 0 questTag = nil isHeader = false isCollapsed = false isComplete = nil color = nil partyMembersOnQuest = nil tempWidth = nil textWidth = nil (for index) = 1 (for limit) = 23 (for step) = 1 i = 1 (temporary) = defined =C:-1 (temporary) = QuestLogDummyText { 0 = } (temporary) = " " (temporary) = nil (temporary) = false (temporary) = nil (temporary) = false (temporary) = nil (*temporary) = "attempt to concatenate local 'questLogTitleText' (a nil value)"

================================================================ The number of errors continues to increase while the quest log frame is open.

105x ...aceWideQuestLogLevels\WideQuestLogLevels.lua:16: bad argument #3 to 'format' (string expected, got nil) C: in function `format' ...aceWideQuestLogLevels\WideQuestLogLevels.lua:16: in function <...aceWideQuestLogLevels\WideQuestLogLevels.lua:1>

Locals: (temporary) = " [%d] %s" (temporary) = 0 (temporary) = nil (temporary) = "string expected, got nil"

chkmyid commented 4 years ago

Occurred when opened to view a description of the completed quest. It seems that the problem occurs when I click on a particular quest.

Aiue commented 4 years ago

Fixed that part of the Blizzard code as well.

chkmyid commented 4 years ago

1.1.6 r2 WoWScrnShot_116r2

1.1.6 r3 WoWScrnShot_116r3

This symptom is still present in the modified code.

Aiue commented 4 years ago

:GetQuestLogTitle() sometimes has nil returns, typically when the quest info is not yet cached. That's what's causing this. Blizzard's own code does not account for this, which I have fixed. In this case, however, it's up to the author of WideQuestLogLevels to accomodate for this, either by concatenating/formatting with "" if it's nil, or simply encapsule the value in a tostring() call. Or silently return.

Either way, this is outside my own code. You should get the same error by opening the questlog by any means, not just through the tracker.

chkmyid commented 4 years ago

The author of WideQuestLogLevels has not responded to my issue. Is there any way I can tell you about this problem?

Should I use another quest log addon? 'Quest Log Extended' is an alternative because I like simple style, but this addon does not seem to be supported by the author either. I'm in agony.

chkmyid commented 4 years ago

This issue does not occur when used independently.

Aiue commented 4 years ago

Leatrix Plus has a similar feature, although it comes bundled together with a whole range of other things. From what I can tell, it does handle the questlog quite elegantly.

There is also Classic Quest Log.

This issue does not occur when used independently.

That's strange, because this is entirely caused by GetQuestLogTitle() (and possibly GetQuestLogText()) returning nil values. And I do not modify that API call in any way, only call it.

The only thing I can think of that could remotely affect this, even though it is definitely a long shot, is that I hook into the questlog OnClick handler. I'll be taking a look at that function to see if I can improve it, in the meanwhile, you could try commenting out line 359 in Core.lua and see if that does anything, although I doubt it will. Not that tracking/untracking by shift-clicking in the log will have no effect if you do this.

hooksecurefunc("QuestLogTitleButton_OnClick", QuestLogClick) to --hooksecurefunc("QuestLogTitleButton_OnClick", QuestLogClick)