Questie

Questie

116M Downloads

Tracker failed to update quest on error message "QUEST failed: Inventory is full."

Cabro opened this issue ยท 1 comments

commented

The addon failed to remove a quest from tracker after getting an error while turning quest in "Inventory is full."
After i freed up a space in bags and turning in successfully, the addon still had the quest in tracker.

8.4.2

commented

Quick summary:

In my efforts to reduce the number of times QuestieTracker:Update() fires, I inadvertently failed to realize that it might possibly skip a needed update. As in this edge case... Inventory Full!

UNIT_QUEST_LOG_CHANGED fires and it's determined that no Quest Log Update is required (due to the inventory is full error) and exits but not before setting a "no full scan" flag... which doesn't get cleared.

Player empties bag to make room for Quest Item then hands in the Quest again. When QUEST_LOG_UPDATE fires and a "full scan" is skipped, this too skips the QuestieTracker:Update().

Updated this code to fire QuestieTracker:Update() if a full scan is NOT done. _QuestEventHandler:UpdateAllQuests() already runs a QuestieTracker:Update() at the bottom of its function so NO duplicate updates will run along this test case. This should cover other edge cases where a Quest hand in might get interrupted.

---Fires when the quest log changed in any way. This event fires very often!
function _QuestEventHandler:QuestLogUpdate()
    Questie:Debug(Questie.DEBUG_DEVELOP, "[Quest Event] QUEST_LOG_UPDATE")

    local continueQueuing = true
    -- Some of the other quest event didn't have the required information and ordered to wait for the next QLU.
    -- We are now calling the function which the event added.
    while continueQueuing and next(questLogUpdateQueue) do
        continueQueuing = _QuestLogUpdateQueue:GetFirst()()
    end

    if doFullQuestLogScan then
        doFullQuestLogScan = false
        -- Function call updates doFullQuestLogScan. Order matters.
        _QuestEventHandler:UpdateAllQuests()
    else
        QuestieCombatQueue:Queue(function()
            QuestieTracker:Update()
        end)
    end
end