# Mentioning problem with short usernames

**URL:** https://meta.discourse.org/t/mentioning-problem-with-short-usernames/37170
**Category:** Bug
**Created:** [December 27, 2015, 11:17am UTC](https://meta.discourse.org/t/mentioning-problem-with-short-usernames/37170 "2015-12-27T11:17:32Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![rumpelsepp](https://avatars.discourse-cdn.com/v4/letter/r/bc79bd/32.png) [@rumpelsepp](https://meta.discourse.org/u/rumpelsepp)
#### Post date: [December 27, 2015, 11:17am UTC](https://meta.discourse.org/t/mentioning-problem-with-short-usernames/37170/1 "2015-12-27T11:17:32Z")

</div>

I have a user who has a username of one character (`f`). Since Discourse 1.5.betaX mentioning that user with `@f` does not work anymore. I can remember that it worked in Discourse 1.4.X.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [December 27, 2015, 10:02pm UTC](https://meta.discourse.org/t/mentioning-problem-with-short-usernames/37170/2 "2015-12-27T22:02:13Z")

</div>

The database queries are too expensive when matching a single character.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [January 5, 2016, 3:23am UTC](https://meta.discourse.org/t/mentioning-problem-with-short-usernames/37170/3 "2016-01-05T03:23:09Z")

</div>

Do you support amending this query with the site setting of minimum username length, @sam?

---

<div class="post-metadata">

### Author: ![Mittineague](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mittineague/32/114259_2.png) [@Mittineague](https://meta.discourse.org/u/Mittineague)
#### Post date: [January 5, 2016, 3:27am UTC](https://meta.discourse.org/t/mentioning-problem-with-short-usernames/37170/4 "2016-01-05T03:27:37Z")

</div>

If the auto-suggest starts working on the first sign of the token like the emoji does, I hate to think of the resource cost of all the false starts.

If it could happen _after_ the “end token” (a space?) it might not be so bad.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [January 5, 2016, 3:29am UTC](https://meta.discourse.org/t/mentioning-problem-with-short-usernames/37170/5 "2016-01-05T03:29:48Z")

</div>

I don’t know, @zogstrip introduced this change cause autocomplete usernames was brutal.

I feel like single letter usernames are such an edge case that I don’t want to even risk making any changes there. Maybe if we supported Chinese usernames one day I would be more open to hacking on this further.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [January 5, 2016, 3:30am UTC](https://meta.discourse.org/t/mentioning-problem-with-short-usernames/37170/6 "2016-01-05T03:30:00Z")

</div>



---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [January 6, 2016, 5:53pm UTC](https://meta.discourse.org/t/mentioning-problem-with-short-usernames/37170/7 "2016-01-06T17:53:26Z")

</div>

I have tested against our largest instances and username autocomplete is super fast, especially on 1-letter username. What I am missing here?

Since we can’t use `SiteSettings` in the mention dialect, I pushed this fix to allow for any username length. It was limited to at least **2** characters before that. (cc @rumpelsepp)

[https://github.com/discourse/discourse/commit/f654528aa464af268af6051e7699ba1eeee65cfb](https://github.com/discourse/discourse/commit/f654528aa464af268af6051e7699ba1eeee65cfb)
