Fix state persistence and cross-faction profile wipes#374
Open
MikeO7 wants to merge 1 commit into0xbs:masterfrom
Open
Fix state persistence and cross-faction profile wipes#374MikeO7 wants to merge 1 commit into0xbs:masterfrom
MikeO7 wants to merge 1 commit into0xbs:masterfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
preferredFiltersnatively 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 fromc2f4toc2f5). Users thought their filters were arbitrarily getting deleted when they clicked anything outside PGF.Fix: Clamped the
bit.bandexplicitly to15to only respect core PvE/PvP/Recommended bits!2. Fixed
autoCheckboxforce-deleting manual checkbox statesWhen reopening the LFG Window,
Init()naturally restores configurations usingSetText(). However,SetTextmistakenly triggeredOnTextChanged, causingautoCheckbox()to evaluate in the background. If a user had checked a box but left the text field empty,autoCheckboxwould aggressively reset their checkbox tofalseduring the frame load.Fix: PGF now only fires
autoCheckboxvalidations ifisUserInputevaluates dynamically to true.3. Fixed data loss on
Advanced Expressionstring inputsWhen users typed an advanced expression, PGF only committed the string to
SavedVariableswhen the text box physically received anOnEditFocusLostevent. 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
OnTextChangedevent, ensuring one-to-one keystroke syncing.