small-lovely-cat reported a bug in the avatar-flair component where the autoGroupFlairForUser function failed to prioritize user-selected userGroup flair. Consequently, the system would incorrectly fall back to automatic group flair (such as Trust Level badges) even when a user had manually set a specific group flair. This issue caused display inconsistencies, such as incorrect flairs appearing in direct messages or chat until a page refresh occurred.
The report links to a pull request that resolves the issue by modifying the logic to check for user-selected flair first, using the automatic group flair only as a fallback.
There exists a problem in avatar-flair. The function fails to consider userGroup flair, and will fallback to autoGroup flair even when the user set a userGroup flair.
This will cause the flair shown incorrectly in places like chat, e.g., I set my flair to a group flair, but the flair of my DM will be the one of my Trust Level without a refresh.
This commit fix this by considering user selected flair first, while keeping autoGroupFlair as a fallback.