Skip to content

Commit 7d691d0

Browse files
committed
Release v3.26.1
2 parents 747ce06 + 1abe960 commit 7d691d0

5 files changed

Lines changed: 58 additions & 4 deletions

File tree

AutoDelete.lua

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4083,7 +4083,7 @@ _G.AutoDelete_TooltipCache = _G.AutoDelete_TooltipCache or {
40834083
-- so we drop the affected sub-cache here when the version doesn't
40844084
-- match. Bump _CACHE_VERSION whenever parsing semantics change.
40854085
do
4086-
local _CACHE_VERSION = 7
4086+
local _CACHE_VERSION = 8
40874087
if _G.AutoDelete_TooltipCache._cacheVersion ~= _CACHE_VERSION then
40884088
_G.AutoDelete_TooltipCache.affix = {}
40894089
_G.AutoDelete_TooltipCache.affixName = {}
@@ -4097,7 +4097,12 @@ end
40974097
function _G.AutoDelete_GetRecipeKnowledgeState(bag, slot, link)
40984098
if not bag or not slot or not link then return "uncertain" end
40994099
local cache = _G.AutoDelete_TooltipCache and _G.AutoDelete_TooltipCache.recipeKnown
4100-
if cache and cache[link] then return cache[link] end
4100+
if _G.AutoDelete_GetRecipeKnowledgeCacheHit then
4101+
local cachedState = _G.AutoDelete_GetRecipeKnowledgeCacheHit(cache, link)
4102+
if cachedState then return cachedState end
4103+
elseif cache and cache[link] == "known" then
4104+
return "known"
4105+
end
41014106

41024107
local knownToken = ITEM_SPELL_KNOWN
41034108
if type(knownToken) ~= "string" or knownToken == "" then
@@ -4123,7 +4128,15 @@ function _G.AutoDelete_GetRecipeKnowledgeState(bag, slot, link)
41234128
local state = _G.AutoDelete_DetectRecipeKnowledgeFromTooltipLines(lines, knownToken)
41244129
recipeTip:Hide()
41254130

4126-
if cache then cache[link] = state end
4131+
if _G.AutoDelete_RememberRecipeKnowledgeState then
4132+
_G.AutoDelete_RememberRecipeKnowledgeState(cache, link, state)
4133+
elseif cache then
4134+
if state == "known" then
4135+
cache[link] = "known"
4136+
else
4137+
cache[link] = nil
4138+
end
4139+
end
41274140
return state
41284141
end
41294142

AutoDelete.toc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
## Title: |cffff8000AutoDelete|r
33
## Notes: Automatically delete and sell specified items from your bags.
44
## Author: Baenre
5-
## Version: 3.26
5+
## Version: 3.26.1
66
## OptionalDeps: ProjectEbonhold
77
## SavedVariables: AutoDeleteDB
88
## SavedVariablesPerCharacter: AutoDeleteStatsDB

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
44

55
## Unreleased
66

7+
## [3.26.1] - 2026-06-16
8+
9+
### Hot Fix
10+
11+
- **Duplicate known recipes now sell after learning one copy.** Sell Known Recipes no longer keeps a stale unknown result for matching recipe links, so the remaining copy can be rescanned and sold once it is known.
12+
713
## [3.26] - 2026-06-15
814

915
### Added

RecipeRules.lua

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,21 @@ function _G.AutoDelete_DetectRecipeKnowledgeFromTooltipLines(lines, knownToken)
6363
return "unknown"
6464
end
6565

66+
function _G.AutoDelete_GetRecipeKnowledgeCacheHit(cache, link)
67+
if not cache or not link then return nil end
68+
if cache[link] == "known" then return "known" end
69+
return nil
70+
end
71+
72+
function _G.AutoDelete_RememberRecipeKnowledgeState(cache, link, state)
73+
if not cache or not link then return end
74+
if state == "known" then
75+
cache[link] = "known"
76+
else
77+
cache[link] = nil
78+
end
79+
end
80+
6681
function _G.AutoDelete_GetKnownRecipeSellDecision(profile, bag, slot, link, itemClass, itemSubType, itemQuality, isQuestItem, onExplicitSell)
6782
if not profile or profile.knownRecipeSellEnabled ~= true then return nil end
6883
if not _G.AutoDelete_IsRecipeLikeItem(itemClass, itemSubType) then return nil end

spec/recipe_rules_spec.lua

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ local function reloadRules()
44
_G.AutoDelete_IsRecipeLikeItem = nil
55
_G.AutoDelete_IsKnownRecipeQualityEnabled = nil
66
_G.AutoDelete_GetRecipeQualityLabel = nil
7+
_G.AutoDelete_DetectRecipeKnowledgeFromTooltipLines = nil
8+
_G.AutoDelete_GetRecipeKnowledgeCacheHit = nil
9+
_G.AutoDelete_RememberRecipeKnowledgeState = nil
710
_G.AutoDelete_GetKnownRecipeSellDecision = nil
811
_G.AutoDelete_IsRecipeDeleteProtected = nil
912
dofile("RecipeRules.lua")
@@ -66,6 +69,23 @@ describe("Sell Known Recipes rules", function()
6669
assert.are.equal("uncertain", _G.AutoDelete_DetectRecipeKnowledgeFromTooltipLines({}))
6770
end)
6871

72+
it("does not cache unknown recipe knowledge by link so duplicate recipes can be rescanned", function()
73+
local cache = {}
74+
local link = "item:12345"
75+
76+
_G.AutoDelete_RememberRecipeKnowledgeState(cache, link, "unknown")
77+
assert.is_nil(_G.AutoDelete_GetRecipeKnowledgeCacheHit(cache, link))
78+
assert.is_nil(cache[link])
79+
80+
_G.AutoDelete_RememberRecipeKnowledgeState(cache, link, "uncertain")
81+
assert.is_nil(_G.AutoDelete_GetRecipeKnowledgeCacheHit(cache, link))
82+
assert.is_nil(cache[link])
83+
84+
_G.AutoDelete_RememberRecipeKnowledgeState(cache, link, "known")
85+
assert.are.equal("known", _G.AutoDelete_GetRecipeKnowledgeCacheHit(cache, link))
86+
assert.are.equal("known", cache[link])
87+
end)
88+
6989
it("sells a known recipe only when the quality toggle allows it", function()
7090
local action, reason, rule, state, qualityEnabled =
7191
_G.AutoDelete_GetKnownRecipeSellDecision(profile(), 0, 1, "item:1", "Recipe", nil, 2, false, false)

0 commit comments

Comments
 (0)