Skip to content

Fix state persistence and cross-faction profile wipes#374

Open
MikeO7 wants to merge 1 commit into0xbs:masterfrom
MikeO7:fix-state-persistence
Open

Fix state persistence and cross-faction profile wipes#374
MikeO7 wants to merge 1 commit into0xbs:masterfrom
MikeO7:fix-state-persistence

Conversation

@MikeO7
Copy link
Copy Markdown
Contributor

@MikeO7 MikeO7 commented Apr 12, 2026

This PR resolves a series of interconnected bugs that were unintentionally wiping user profiles and discarding configurations under certain conditions:

1. Prevented "Cross-Faction" from wiping Profile States
preferredFilters natively updates whenever a user toggles "Cross-Faction Play" or selects languages in the Blizzard UI. Because PGF blindly incorporated this bitmask into its profile generator ID (allFilters = bit.bor), toggling Cross-Faction created an entirely new, blank state array (e.g. going from c2f4 to c2f5). Users thought their filters were arbitrarily getting deleted when they clicked anything outside PGF.
Fix: Clamped the bit.band explicitly to 15 to only respect core PvE/PvP/Recommended bits!

2. Fixed autoCheckbox force-deleting manual checkbox states
When reopening the LFG Window, Init() naturally restores configurations using SetText(). However, SetText mistakenly triggered OnTextChanged, causing autoCheckbox() to evaluate in the background. If a user had checked a box but left the text field empty, autoCheckbox would aggressively reset their checkbox to false during the frame load.
Fix: PGF now only fires autoCheckbox validations if isUserInput evaluates dynamically to true.

3. Fixed data loss on Advanced Expression string inputs
When users typed an advanced expression, PGF only committed the string to SavedVariables when the text box physically received an OnEditFocusLost event. If a user typed a string and instantly closed the LFG window (via hitting 'X'), the application tore down before focus was formally resolved, silently discarding their string!
Fix: Linked state string persistence directly into the OnTextChanged event, ensuring one-to-one keystroke syncing.

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