If this is the case, then indeed there is some weirdness around the dates, possibly caused by our automatic migration. Run this:
CustomEmoji.find_by(name: "success").upload.upload_references.order("created_at ASC, id ASC")
To find the UploadReference record that says target_type: "CustomEmoji", then do:
UploadReference.find(ID).update!(created_at: UploadReference.find(752).created_at - 1.day))
Then run this on the troublesome upload:
upload.update_secure_status
And it should be resolved…I really think this will mostly be an issue with older uploads since this migration. Another thing you may be able to do is delete the custom emoji, re-upload it, then run:
Jobs.enqueue(:rebake_custom_emoji_posts, name: EMOJI_NAME)
The date update will be easier though. Sorry for the muck-around on this!