Skip to content

fix(unitframes): Player Aura Bars sometimes not loading on login - #2056

Open
JuJuFX-dev wants to merge 1 commit into
EllesmereGaming:mainfrom
JuJuFX-dev:fix/pab-login-build
Open

fix(unitframes): Player Aura Bars sometimes not loading on login#2056
JuJuFX-dev wants to merge 1 commit into
EllesmereGaming:mainfrom
JuJuFX-dev:fix/pab-login-build

Conversation

@JuJuFX-dev

Copy link
Copy Markdown
Contributor

Bugreport: https://discord.com/channels/585577383847788554/1547821004644946010

What does this PR do?

Fixes Player Aura Bars sometimes not loading on login. The affected player sees Blizzard's default buff frame instead of the PAB default bars, and custom bars (e.g. defensives) do not show at all, with no Lua error. Opening the EllesmereUI options, or any other change that reaches ReloadFrames, brings everything back until the next login. It was reported with BigWigs enabled and went away with BigWigs disabled.

Root cause: the login build hung off a PLAYER_LOGIN handler in EllesmereUIUnitFrames_PlayerAuraBars.lua whose first line was if not ns._eufEnabled then return end. That flag is stamped by EnableBody(), which runs from a different PLAYER_LOGIN handler in EllesmereUIUnitFrames.lua, so the build only worked when that handler had already run. Whenever PAB's handler ran first it stood down silently, with no retry and no error: HideBlizzardPlayerAuras() and the custom bar build both live inside CreateBars(), so neither happened. The only later build path is PAB_ProfileResync() at the tail of ReloadFrames, which is why an options change fixed it.

The fix removes the dependency on handler order instead of patching around it. SetupOptionsPanel(), the point where ns.db is set, now calls ns.PAB_CreateBars() directly, following the existing ns._InitEUIModule() call in the same function. That removes the PAB PLAYER_LOGIN branch, the TryCreateBars retry loop and the ns._eufEnabled stamp. The build lands in the same tick as before (the old first retry ran right after SetupOptionsPanel). A disabled Unit Frames module never runs SetupOptionsPanel, so PAB still stays down there without a separate check.

How was it tested?

Tested in-game on live.

Screenshots

N/A, no visual change beyond the bars showing at login as intended.

Checklist

  • New settings default OFF (no behavior change without opt-in): N/A, no new settings
  • Zero cost while disabled: no events registered, no polling, no hooks doing work, no frames built
  • Cheap while enabled: event-driven (no polling, no timer-based logic, no per-frame allocations); the login retry timer is gone, the build is a single direct call
  • No writes onto Blizzard-owned frames (weak-table pattern used); HookScript/hooksecurefunc only, never SetScript on Blizzard frames: N/A, Blizzard frame handling is unchanged
  • Tested in-game on live; no version gates or pre-Midnight APIs added

…d of a login poll

The login build relied on PAB's PLAYER_LOGIN handler running after the Unit
Frames enable router in another file. When it ran first, the ns._eufEnabled
guard stood PAB down silently: Blizzard's BuffFrame stayed up and no custom
bar was built until an options change reached PAB_ProfileResync. Reported
with BigWigs enabled.

SetupOptionsPanel now calls ns.PAB_CreateBars once ns.db is set, which drops
the PLAYER_LOGIN branch, the retry loop and the _eufEnabled stamp. A disabled
Unit Frames module never runs SetupOptionsPanel, so PAB still stays down.
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