From f5be9f0102e622356ebff31f7000adc71d17d8d6 Mon Sep 17 00:00:00 2001 From: Florian Berthold Date: Wed, 10 Jun 2026 02:15:57 +0200 Subject: [PATCH] fix(scrolls): don't cache scrolls whose tooltip scraped empty TryResolve cached an entry even when ScanItemTooltip returned 0 lines (empty string is truthy in Lua), so empty-tooltip scrolls were treated as cache hits forever and never retried - and per-pass stats disagreed with the cache. Only cache once at least one tooltip line was captured, and treat cached-but-empty entries (stale SavedVariables) as misses. --- CoaExporter/Collectors/MysticScrolls.lua | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/CoaExporter/Collectors/MysticScrolls.lua b/CoaExporter/Collectors/MysticScrolls.lua index a8fbd23..df6e97c 100644 --- a/CoaExporter/Collectors/MysticScrolls.lua +++ b/CoaExporter/Collectors/MysticScrolls.lua @@ -71,7 +71,8 @@ end local function TryResolve(entry) local cache = CoaExporterScrollCache.entries - if cache[entry.itemID] and cache[entry.itemID].itemTooltip then + local hit = cache[entry.itemID] + if hit and hit.itemTooltip and hit.itemTooltip ~= "" then return true end local name, _, quality = GetItemInfo(entry.itemID) @@ -82,6 +83,11 @@ local function TryResolve(entry) return false end local itemLines = ScanItemTooltip(entry.itemID) + if #itemLines == 0 then + -- Tooltip not server-resolved yet; don't cache an empty entry, or + -- this scroll would never be retried on later passes. + return false + end local spellName, spellRank if GetItemSpell then spellName, spellRank = GetItemSpell(entry.itemID) @@ -97,7 +103,7 @@ local function TryResolve(entry) itemTooltip = table.concat(itemLines, "\n"), fetchedAt = time(), } - return #itemLines > 0 + return true end function AE.ScrollsScanPass()