User gravatar not generated after import via script

When I batch created users via the API, the user gravatars were generated automatically. It took a while, but eventually they showed up. However, now I am importing users, posts, topics the “right way” via a custom ruby import script. I have not yet seen any gravatars get generated by my site.

I do have the setting enabled for “automatically download gravatars” – “Download Gravatars for users upon account creation or email change.” I wonder if bringing in users via import script does not count as “create” in the same was as import does.

I know my avatar settings work because during my user import process, I had a user auto-provisioned via SSO, which came along with a gravatar. I quickly deleted the user since he had not yet been imported yet, and he was imported as expected yet without a gravatar.

My log is empty. And so is my brain. I got nothin.

Thanks for any tips anyone can offer.

Adding a bit more info… when a user logs in to our WordPress site, the SSO payload automatically sends the gravatar image with it. So several hours later I am seeing some images. However, I would like our transition to the new site to be as seamless as possible and want the gravatars there from the beginning.

An alternative is to iterate through my users via the API, which I already have code for. Perhaps I can just change their username since it is already their emailprefix+random 4-digit int (like, “first.last8039”, “dudeMan3861”, etc.). I changed a username in the front-end and the Gravatar was immediately generated.

Does anyone know how to emulate an SSO payload for a user from the WP site? If so, I could write a script to iterate through my users on the WP side just to sort of “touch” my Discourse site.