discourse/plugins/chat/spec/services
Andrei Prigorshnev e83d8fb3e2
FIX: Allow several chat channels to have an empty slug (#25680)
In certain cases, chat channels may have empty slugs, it happens when:

1. The `slug_generation_method` setting is set to `None`
2. `slug_generation_method` is set to `ASCII` and a channel with 
a Unicode name and an empty slug is created (in this case, the code 
that creates channels tries to generate a slug and fallbacks to an empty slug)

At the moment, we have a unique index on the `chat_channels.slug` column 
which leads to errors when creating several channels with empty slugs 
(Discourse is able to create one such channel, but when trying to create 
the second one fails because of the unique constraint). This PR fixes that 
by adding a `where` condition to the index. Slugs still have to be unique, 
but now many channels may have empty slugs.

This fix is similar to the one we made to the category slugs – 7ba914f1e1.
2024-02-15 00:39:39 +04:00
..
actions DEV: Allow fab! without block (#24314) 2023-11-09 16:47:59 -06:00
auto_remove DEV: Remove full group refreshes from tests (#25414) 2024-01-25 14:28:26 +08:00
chat FIX: Allow several chat channels to have an empty slug (#25680) 2024-02-15 00:39:39 +04:00
hashtag_autocomplete_service_spec.rb DEV: Chat hashtag test (#25638) 2024-02-12 12:32:52 +10:00