From 1e453e5e99e8f4b11e7f9b7dbe81ad45f5d2f32f Mon Sep 17 00:00:00 2001 From: Glyalith Date: Fri, 7 Aug 2026 20:20:45 -0600 Subject: [PATCH] Fix party reload permanently writing overrides onto nil raid keys ReloadPartyFrames temp-swaps party overrides onto db.profile so the anchor closures that captured it read party values, then restores from a table populated with saved[key] = raw[key]. Assigning nil stores nothing, so a mapped key whose raid value is nil never entered the table, the restore loop skipped it, and the party value stayed on the shared raid key and saved to disk. Keys with a default are immune (NewDB merges defaults into the profile at load, so their raid value is never nil in memory). Nine mapped keys have no default: tooltipMode, debuffIconZoom, defIconZoom, absorbBarPosition, dispelIconBorderSize, and the four borderTexture offset/shift keys. Repro: unsync Extras on the Party tab, set Tooltip Mode to "never" on a profile that never changed the raid value, and the raid frames stop showing tooltips too. Record the swapped keys in a presence list and restore from that, so a nil raid value is written back as nil instead of skipped. --- EllesmereUIRaidFrames/EllesmereUIRaidFrames.lua | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/EllesmereUIRaidFrames/EllesmereUIRaidFrames.lua b/EllesmereUIRaidFrames/EllesmereUIRaidFrames.lua index f86dcffa..4e12f933 100644 --- a/EllesmereUIRaidFrames/EllesmereUIRaidFrames.lua +++ b/EllesmereUIRaidFrames/EllesmereUIRaidFrames.lua @@ -11343,12 +11343,16 @@ ns.ReloadPartyFrames = function() -- Temp-swap: write party overrides onto db.profile so anchor closures -- (which captured db.profile) read party values. Only for keys whose - -- section is custom (unsynced). - local saved = {} + -- section is custom (unsynced). `swapped` records WHICH keys were swapped: + -- a key whose raid value is nil (no default, never set on raid) stores + -- nothing in `saved`, so restoring from `saved` alone would skip it and + -- leave the party value on the shared raid key permanently. + local saved, swapped = {}, {} for key, section in pairs(ns._PARTY_KEY_SECTION) do if ns._IsPartySectionCustom(section) then local pv = rawget(raw, "party_" .. key) if pv ~= nil then + swapped[#swapped + 1] = key saved[key] = raw[key] raw[key] = pv end @@ -11504,9 +11508,10 @@ ns.ReloadPartyFrames = function() end end - -- Restore db.profile to raid values - for key, val in pairs(saved) do - raw[key] = val + -- Restore db.profile to raid values (via `swapped`, so a nil raid value + -- is written back as nil rather than skipped) + for _, key in ipairs(swapped) do + raw[key] = saved[key] end -- Re-layout header