Skip to content

Fix Aura Designer cold-cache miss on first aura application#53

Merged
DanderBot merged 1 commit into
DanderBot:mainfrom
Krathe82:fix/ad-cold-cache-bootstrap
May 8, 2026
Merged

Fix Aura Designer cold-cache miss on first aura application#53
DanderBot merged 1 commit into
DanderBot:mainfrom
Krathe82:fix/ad-cold-cache-bootstrap

Conversation

@Krathe82
Copy link
Copy Markdown
Contributor

@Krathe82 Krathe82 commented May 8, 2026

Summary

  • Fixes AD indicators not firing on the very first aura application after joining a group or entering a zone (bug #834, same root cause as #836)
  • Removes dead legacy GetUnitAuras fallback code that has been a no-op since Midnight 12.0+ removed that API

Root cause

AuraAdapter:GetUnitAuras() has a fast path (reads from DF.AuraCache) and a legacy fallback for when cache.hasFullScan is false. The fallback used GetUnitAuras directly — an API that no longer exists on Midnight 12.0+. The elseif GetUnitAuras condition silently evaluated false, so the function returned an empty table. Indicators didn't fire, then corrected themselves on the next UNIT_AURA event once the cache was properly populated.

The race window is ~0.2s after a roster change (the DirectModeRosterUpdate delay), so it's hard to hit in normal play but real in scripted scenarios or on zone entry with existing auras.

The code itself had a TODO comment flagging this exact fix since ~2026-04-15.

Fix

Replace the dead elseif GetUnitAuras branch with a synchronous ScanUnitFull(unit) call. If the cache is cold when GetUnitAuras is called, populate it right now and read from it. All subsequent calls take the normal fast path.

Test plan

  • Verify AD indicators still fire correctly in normal use (no regression)
  • No Lua errors on /rl with AD enabled
  • No Lua errors on zone entry or group join with tracked auras active

When the Aura Designer renders a frame whose unit hasn't had a UNIT_AURA
event processed yet (hasFullScan = false), GetUnitAuras fell through to a
legacy GetUnitAuras fallback that no longer exists on Midnight 12.0+.
The elseif condition silently evaluated false and returned an empty table,
causing indicators to not fire on the very first aura application.

Replace the dead legacy branch with a synchronous ScanUnitFull call so
the cache is bootstrapped in-place before the result is built. All
subsequent calls hit the normal fast path (hasFullScan is now true).

Fixes bug #834. Same root cause as bug #836.
@DanderBot DanderBot merged commit ccb867d into DanderBot:main May 8, 2026
DanderBot added a commit that referenced this pull request May 8, 2026
- Auras.lua: gate pinned-frame UNIT_AURA fallback on set.enabled and
  child:IsVisible() to mirror TriggerAuraUpdateForUnit; fix misleading
  'children are contiguous' comments in both OnUnitAura and
  DirectScanAllUnits since pinned headers pre-create all 40 children.
- AuraAdapter.lua: remove dead 'elseif GetUnitAuras' branch in the
  unmatched-IDs debug-logging block — GetUnitAuras was removed in
  Midnight 12.0+ and the branch is unreachable now that ScanUnitFull
  bootstraps the cache.
- AuraDesigner/Options.lua: remove redundant Mixin(banner,
  BackdropTemplateMixin) — the banner is already created with the
  BackdropTemplate so SetBackdrop is always present.
- Locales/enUS.lua: remove orphan L["Trigger"] and
  L["Alert When Expiring"] keys no longer referenced after the
  sound-indicator rework.
@DanderBot
Copy link
Copy Markdown
Owner

Merged in v4.3.8-alpha.1 — thanks for the fix, @Krathe82!

Bug #834 (and its sister bug #836) is now marked Fixed - Next Update on Discord and fixed_in_alpha on Lab. CI will publish to the CurseForge alpha channel shortly.

@Krathe82 Krathe82 deleted the fix/ad-cold-cache-bootstrap branch June 4, 2026 12:40
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.

2 participants