# Заглавные буквы в имени пользователя нарушают проверку достижимого упоминания в редакторе

**URL:** https://meta.discourse.org/t/uppercase-letters-in-username-break-reachable-mention-check-in-composer/401292
**Category:** Bug
**Tags:** mentions
**Created:** [22.Апрель.2026 19:47:26 UTC](https://meta.discourse.org/t/uppercase-letters-in-username-break-reachable-mention-check-in-composer/401292 "2026-04-22T19:47:26Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [22.Апрель.2026 21:26:53 UTC](https://meta.discourse.org/t/uppercase-letters-in-username-break-reachable-mention-check-in-composer/401292/2 "2026-04-22T21:26:53Z")

</div>

Отличная находка, @thoka!

Проблема здесь:

> <https://github.com/discourse/discourse/blob/main/app/controllers/composer_controller.rb#L29>

`users` возвращает `{"username_lower" => объект User }`.

Однако, если `name` не приведен к нижнему регистру, `users[name]` не существует.

Исправление:

```plaintext
if user = users[name.downcase]
...
elsif group = groups[name.downcase]
...

```

Или ещё лучше: приведите все имена к нижнему регистру в начале метода, так как там много проблем. `groups` корректно использует `.where("lower(name) IN (?)", @names.map(&:downcase))`, но функции `visible_group_ids_for_allowed_check`, `topic_allowed_group_ids`, `mentionable_group_ids` и `members_visible_group_ids` все используют `where(name: @names)`, что также вносит проблемы с чувствительностью к регистру.

---

_[View the full topic](https://meta.discourse.org/t/uppercase-letters-in-username-break-reachable-mention-check-in-composer/401292)._
