Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tootctl emoji import: case insensitive duplicate check #15738

Merged
merged 1 commit into from
Mar 24, 2021

Conversation

angristan
Copy link
Contributor

I added a few hundreds of emojis to one of my instances using tootctl emoji import and tar.gz files.

Some of them had duplicates with different case, like this:

screenshot_2021-02-15_19-47-31

They are displayed correctly in the admin and don't cause any issue during import.

However they don't display correctly:

screenshot_2021-02-15_19-52-25

So I ended up removing the duplicates and reuploading the ones that had the same shortcode with a different case but a different image.

As explained by someone on discord (not sure if they want their name to be quoted)

the db schema for custom emoji is case sensitive, but CustomEmoji .search uses SQL's ILIKE operator it's not case sensitive.
this means you can add emojis as case sensitive, but it can't be used as case sensitive.

To a least fix the batch import, I have come up with the fix attached to this PR which check of existing emojis regardless of the case.

That fixed the issue for me, for example if I have the LoL emoji, importing a tarball containing lol.png worked, but with the PR it would skip it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants