SSO Avatars not updating as expected

In our environment, users can change their avatar any time they want. They change it by re-dressing their 3D character. When they’re done re-dressing we render the 3D character and save a new avatar image. During the rendering process we briefly set the avatar as an “N/A” icon.

We seem to have 2 problems:

  1. Discourse is detecting the change in avatar and picking up the N/A icon, but not detecting new avatar that is generated soon after. This means users who change their avatar can end up stuck with the N/A icon. Caching issue?

  2. Users who access our discourse from certain mobile/tablet devices have their avatars switch to N/A for no apparent reason. They did not change their appearance.

User experiences of problem 2:
“I logged in from my iPad while still logged in on my pc and it seems I lost my avatar. I haven’t updated my character appearance in a while, so I’m not sure why it couldn’t get the image.”

“When I login to the dev forums from my Nexus 6p, it nulls my avatar on the dev forum. It comes back once I re-login on web.”

Many users are able to “fix” the problem by fully logging out of discourse and ROBLOX, then log back into both. If they just log out of discourse and back in the problem is not always fixed.

This is happening so much our users are complaining. It ends up looking like this on our site (3 different N/A poster avatars). They can’t tell who is posting.

Our settings:
sso overrides avatar is ON
allow uploaded avatars is OFF
automatically download gravatars is OFF

More example N/A avatars:


Topics with only one N/A avatar in the Users column are the lucky ones

Sure @sam will have a look.

I think the solution here is to perform a sync_sso call after the avatar processing has finished, and not before. So the only people with broken avatars will be those who re-logged.

(Make sure to include the avatar force update flag, whatever it’s called)