Skip to content

Fix(Bags): set categories missing after login until a set is saved - #3581

Merged
EllesmereGaming merged 1 commit into
EllesmereGaming:mainfrom
svart2521:bug#448
Nov 24, 2026
Merged

EllesmereGaming merged 1 commit into
EllesmereGaming:mainfrom
svart2521:bug#448

Conversation

@svart2521

Copy link
Copy Markdown
Contributor

What does this PR do?

Fixes per-set categories disappearing after a relog when Split Set Gear by Set is on (bug #448). The bank fell back to Item Set Gear split by equipment slot, and the bags to one combined Item Set Gear section, until a set was saved again.

Cause: the per-set categories are created once, when the category list is first built, and the list is then cached. At login that first build can run before the client has delivered the equipment sets, so the list caches without them. The only rebuild trigger is EQUIPMENT_SETS_CHANGED, which does not fire again until a set is saved. Item-to-set matching is rebuilt on every sort, so set items were still recognised and fell back to the shared Item Set Gear category.

Fix:

  • In ClassifyItem, during a split-mode ClassifyAll pass, a set item whose set has no category of its own means the list was built too early. It queues one rebuild through EUI_Bags.InvalidateSetCategories() (keeps the selected category) and repaints.
  • The rebuild runs on the next frame from a one-shot frame, since callers hold the category list during the pass.
  • It retries once per set list; OnEquipmentSetsChanged re-arms it.

Known limit: if the client ever reports a set with no name after login, its category still waits for the next set change.

Cost: nothing while Split Set Gear by Set is off. When on, one table lookup on the existing Item Set Gear fallback path; the one-shot frame is created only the first time a rebuild is needed.

How was it tested?

Client: Retail and Forever

  • Saved an equipment set, put its items in the bank, OneBank view: items grouped under the set's category.
  • Relogged: the set category is still there in the bank and in the bags sidebar without saving the set again.
  • Toggled Split Set Gear by Set off and on: the set categories are removed and re-added.

Guardrails and the locale-key check pass.

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 tickers; nothing built beyond an inert event frame or combat queue - the check only runs in split mode
  • Cheap while enabled: event-driven (no polling, no timer-based logic, no per-frame allocations) - one-shot next-frame rebuild, hides itself after one run
  • No writes onto Blizzard-owned frames (weak-table pattern used); HookScript/hooksecurefunc only, never SetScript on Blizzard frames - N/A: no Blizzard frames touched
  • Tested in-game on live; no version gates or pre-Midnight APIs added

## What does this PR do?

Fixes per-set categories disappearing after a relog when Split Set Gear by Set is on ([bug EllesmereGaming#448](https://ellesmereui.com/bugs/448/bank-forgets-equipment-sets-after-logout)). The bank fell back to Item Set Gear split by equipment slot, and the bags to one combined Item Set Gear section, until a set was saved again.

Cause: the per-set categories are created once, when the category list is first built, and the list is then cached. At login that first build can run before the client has delivered the equipment sets, so the list caches without them. The only rebuild trigger is `EQUIPMENT_SETS_CHANGED`, which does not fire again until a set is saved. Item-to-set matching is rebuilt on every sort, so set items were still recognised and fell back to the shared Item Set Gear category.

Fix:
- In `ClassifyItem`, during a split-mode `ClassifyAll` pass, a set item whose set has no category of its own means the list was built too early. It queues one rebuild through `EUI_Bags.InvalidateSetCategories()` (keeps the selected category) and repaints.
- The rebuild runs on the next frame from a one-shot frame, since callers hold the category list during the pass.
- It retries once per set list; `OnEquipmentSetsChanged` re-arms it.

Known limit: if the client ever reports a set with no name after login, its category still waits for the next set change.

Cost: nothing while Split Set Gear by Set is off. When on, one table lookup on the existing Item Set Gear fallback path; the one-shot frame is created only the first time a rebuild is needed.

## How was it tested?

Client: Retail and Forever

- Saved an equipment set, put its items in the bank, OneBank view: items grouped under the set's category.
- Relogged: the set category is still there in the bank and in the bags sidebar without saving the set again.
- Toggled Split Set Gear by Set off and on: the set categories are removed and re-added.

Guardrails and the locale-key check pass.

## Checklist

- [x] New settings default **OFF** (no behavior change without opt-in) - N/A: no new settings
- [x] Zero cost while disabled: no events registered, no polling, no hooks doing work, no tickers; nothing built beyond an inert event frame or combat queue - the check only runs in split mode
- [x] Cheap while enabled: event-driven (no polling, no timer-based logic, no per-frame allocations) - one-shot next-frame rebuild, hides itself after one run
- [x] No writes onto Blizzard-owned frames (weak-table pattern used); `HookScript`/`hooksecurefunc` only, never `SetScript` on Blizzard frames - N/A: no Blizzard frames touched
- [x] Tested in-game on live; no version gates or pre-Midnight APIs added
@EllesmereGaming
EllesmereGaming merged commit cfacaa1 into EllesmereGaming:main Nov 24, 2026
2 checks passed
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