We updated our trust_levels unlocking them all and we see that users stills having old icons titles.
I friendly suggest to disabling users to use trust_levels badges unless their have the required trust_level to display them.
I think Badges needs to be dynamic because trust_level system is dynamic.
That simple modification will solve the problem we are facing, and probably more admins because it’s very common that users ‘loose’ their TL over time.
By icon, do you mean flairs? What do you mean by “not groups”?
Could you share screenshots?
If I set a user to trust_level_3, which is a group having a flair icon, and the user profile flair is set to none, it automatically sets the tryst_level_3 icon nonetheless:
The status quo doesn’t make sense to me, as I only want the current trust level to be apparent in a badge collection. Ideally I’d like it to be the most obvious badge on the user card too (i.e. always displayed in the same prominent location), but not as in-your-face as an avatar flair.
I’ve achieved close to this by replacing the default trust badges with some custom ones that use SQL and revert automatically. Can share them if you like.
I’m sorry, but I’m still not understanding. You started with “We updated our trust_levels unlocking them all” — doesn’t that, by simple definition, mean that all users have reached TL4, the top trust level?
We had TL3 locked. So when we unlocked trust_levels the majority went down (used Discord because people asked for it so almost no interaction on Discourse from a while).
That could be a really good workaround. Please share it if you want!
Some things happen as a result of regular background jobs. You might need to wait a day for changes in trust level to be reflected in the accounts.
With the default setup, people will enter and leave TL3. So it’s normal for a person to join the group and get the badge, and then later to leave the group and lose the badge - I think.
That is, the highest level achieved would be TL3, but if you lost TL3 because you became disengaged, you would normally lose all the signifiers that you ever had TL3. I think.
You are correct - the SQL is visible in the ‘official’ badges and that is what it does. It also is set up to deliberately let the ‘lesser’ trust level badges hang around.
For example, here is the SQL for TL3:
SELECT u.id user_id, current_timestamp granted_at FROM users u
WHERE trust_level >= 3 AND (
:backfill OR u.id IN (:user_ids)
)
As you can’t edit the SQL on ‘official’ badges, my workaround was to simply clone each official badge and change the >= to simply =. This ensures that only one badge is given (at least once the old one has been revoked overnight).
I see now that this might be your actual problem - that the Titles remain on folk after they have lost their trust levels (and badges once revoked on the daily SQL check). I haven’t looked at this in detail to try and repro it, but have you unchecked “Allow badge to be used as title” for those?
I note that this is sorted on the new User Card experiment here in Meta :
That pretty much deals with the issue from my perspective. But it would be nice if it was also sorted on the /u/username/summary.
P.S.
I’ve edited the title of the OP to reflect the focus more tightly. Had moved it to Feature but then realised that we aren’t actually clear on that (yet) - keep going!
They are - it just isn’t instant (revokation only works overnight)
And if they aren’t disappearing for you at all then you might need to get into the rails console.
You might well need to do that to mop up any stray Titles out there too. Shouldn’t be too hard to identify them nor delete the content of the Title field for them.
I’d certainly prefer if the stock Badge queries were set up to revoke superceded badges (as per the SQL tweak above), but that is up to the Discourse @team of course.