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.
This commit is contained in:
Florian Andrew George Berthold 2026-06-10 02:15:57 +02:00
parent 3662193dda
commit f5be9f0102

View file

@ -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()