# Emojis being marked as secure

**URL:** <https://meta.discourse.org/t/emojis-being-marked-as-secure/257425>\
**Category:** Bug\
**Created:** [March 7, 2023, 8:22pm UTC](https://meta.discourse.org/t/emojis-being-marked-as-secure/257425 "2023-03-07T20:22:01Z")\
**Posts on this page:** 1\
**Showing post:** 17

<div class="post-metadata">

**Author:** ![martin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/martin/32/491371_2.png) [@martin](https://meta.discourse.org/u/martin)\
**Post date:** [March 23, 2023, 4:03am UTC](https://meta.discourse.org/t/emojis-being-marked-as-secure/257425/17 "2023-03-23T04:03:53Z")

</div>

If this is the case, then indeed there is some weirdness around the dates, possibly caused by our automatic migration. Run this:

```plaintext
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:

```ruby
UploadReference.find(ID).update!(created_at: UploadReference.find(752).created_at - 1.day))

```

Then run this on the troublesome upload:

```ruby
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:

```ruby
Jobs.enqueue(:rebake_custom_emoji_posts, name: EMOJI_NAME)

```

The date update will be easier though. Sorry for the muck-around on this!

---

_[View the full topic](https://meta.discourse.org/t/emojis-being-marked-as-secure/257425)._
