Skip to content

Fix party reload permanently writing overrides onto nil raid keys - #1260

Open
dfrisone wants to merge 1 commit into
EllesmereGaming:mainfrom
dfrisone:party-tempswap-nil-restore
Open

Fix party reload permanently writing overrides onto nil raid keys#1260
dfrisone wants to merge 1 commit into
EllesmereGaming:mainfrom
dfrisone:party-tempswap-nil-restore

Conversation

@dfrisone

@dfrisone dfrisone commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Found during review of #1256. Silent, permanent overwrite of raid settings by party overrides, for the nine party-overridable keys that have no stored default.

Cause

ReloadPartyFrames temp-swaps party overrides onto db.profile so the anchor closures that captured it read party values, then restores afterwards:

saved[key] = raw[key]   -- store the raid value
raw[key] = pv           -- swap in the party value
...
for key, val in pairs(saved) do raw[key] = val end   -- restore

In Lua, assigning nil into a table is a delete, not a store. A mapped key whose raid value is nil never enters saved, so the restore loop skips it and the party value stays on the shared raid key, then saves to disk. The reload runs on every party settings change, so one edit is enough.

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, borderTextureOffset, borderTextureOffsetY, borderTextureShiftX, borderTextureShiftY.

Repro on current main: unsync EXTRAS on the Party tab, set party Tooltip Mode to "never" on a profile that never changed the raid value, and raid frames stop showing tooltips, permanently.

Change

Record the swapped keys in a presence list and restore by iterating it, so a nil raid value is written back as nil instead of being skipped. Keys with a raid value round-trip exactly as before; this is the only temp-swap site in the module.

No migration: the damage is a plain wrong value on a raid key, indistinguishable from a user choice after the fact. Users affected fix it by setting the raid value back once; it then sticks.

Testing

luac -p passes. An offline round-trip test covers both cases: a defaulted key restores its raid value, a nil-valued key restores to nil (the old loop demonstrably leaves the party value behind).

Verified in game: with EXTRAS unsynced, party Tooltip Mode set to "never" no longer touches the raid value; the Frames tab reading and raid tooltips are unchanged, and both values survive a relog.

Peace Out Goodbye GIF

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant