User flair remains after user is removed from group

If I remove a user from a group, should I expect that group’s flair to be removed from the user’s avatar immediately?

I just removed a user from a group.
She has no primary group selected.

In her preferences, she has no flair selected

I’ve refreshed my browser and logged myself out and back in.

Does she have to log out and back in before the flair is removed? Am I overlooking a step somewhere?


Most jobs are shown in For example if you changed a badge query, you could wait a day for the BadgeGrant job to run, or you could hurry it along by hitting the Trigger button manually. I don’t know which of those jobs updates the flairs though.

1 Like

Yes, except for a tiny edge case of an anonymous user which will see the old flair on some pages for 1 minute.

We will investigate and fix.


User flair also remains when primary group is changed to a new primary group that has a flair associated with it.

1 Like

This is now fixed here

Did you change the primary group using the bulk action “Make All Primary” on the single group page?


No, I changed the primary group of a single user on the user’s admin page.

1 Like

I’d like to let you know that the problem still persists in 2.8.0.beta4 (Commits · discourse/discourse · GitHub)

We haven’t updated yet to the latest commit as there are no changes present to fix this bug.
In our case, user flairs remain unchanged when we update groups via Discourse Connect SSO. We see the user is no present in the group, but flair remains.

Hope it helps identifying and fixing the bug.

This fix won’t work retroactively. You have to update the flairs for old users manually. May I know how many users are affected by this for you?

Wow. Well I don’t know the estimates. Based on our data flows, there may be dozens & hundreds of users leaving/joining specific groups via SSO each day.
Anyway I can count users with outdated (unlinked to groups) flairs?

And how does one even edit other users flairs? I couldn’t find such option in admin panel. Not saying that I’m gonna update so many users one by one to remove this bug’s legacy.

By the way, removing flair from group settings and uploading another flair image doesn’t help. Users out of this group still keep the group flair :frowning:

Just checking if someone knows what to do with this problem

Sorry to bump this post so many times, but this bug is really messing up with our community :frowning:
@vinothkannans do you have any suggestions on how to proceed with it’s effects for us?

User.where(flair_group_id: REPLACE_WITH_GROUP_ID).where.not(primary_group_id: REPLACE_WITH_GROUP_ID).update_all(flair_group_id: nil)

The above command can fix your issue. Run this in your rails console. Please take a backup before performing it.

Thank you for replying.
Do I understand correctly, that due to the effects of this bug, we should perform queries like these on daily or other frequency basis? The thing is that our users group are being updated daily + every time the user’s subscription status changes on the main website. Everything done via SSO.

No, you don’t need to run this regularly. Now the issue is fixed in the above commit. This command will fix the flairs for the users affected before.

I will check for an alternative solution tomorrow.

1 Like

Thanks, I will patiently wait for your investigation results before turning to rails queries.
Please let me know if I may be any help to you on this issue