RetroFed Forum
Your home away from modern life.
Unable to set a display name longer than 20 characters
Post Reply
AuthorMessage
DaPorkchop_ [any] lemmy.ml DaPorkchop_@lemmy.ml
Joined: 2023-06-02
(edited) Quote

While trying to update my display name, I've realized that any display name longer than 20 characters gets rejected (specifically: https://lemmy.ml/api/v3/user/save_user_settings returns 400 with {"error":"invalid_display_name"}). Some digging through the code seems to explain why: Lemmy 0.19.20 (the version running on lemmy.ml) uses the same config option for limiting display name length as it does for usernames, which defaults to 20 (and .ml hasn't changed it from the default value)¹.

I would be satisfied with that explanation, except there are clearly other users on my instance whose display names exceed 20 characters (example: https://lemmy.ml/u/Trying2KnowMyself). So, my question is: how the heck are people able to set these longer display names?

¹ In the 1.0 betas the config option seems to have been replaced with hardcoded limits which are separate for user- and display names, but I don't think that'd be relevant since that's not the code which .ml is actually running

EDIT: I figured it out! Importing user settings from a json backup bypasses display name validation. Most likely the user I referenced as an example had imported their profile from their Hexbear alt, so it ended up just copying their display name over as well.

7   Original
Texas_Hangover lemmy.radio Texas_Hangover@lemmy.radio
Joined: 2024-11-09
#2 · Quote Reply

trying2knowmyself has 17 characters.

1
DaPorkchop_ [any] lemmy.ml DaPorkchop_@lemmy.ml
Joined: 2023-06-02
#3 · Quote Reply

trying2knowmyself has 17 characters.

Their username is Trying2KnowMyself, but their display name is "Trying2KnowMyself [they/them/their/theirs/themself]" which is significantly more than 17 characters

1
Texas_Hangover lemmy.radio Texas_Hangover@lemmy.radio
Joined: 2024-11-09
#4 · Quote Reply

Their username is Trying2KnowMyself, but their display name is "Trying2KnowMyself [they/them/their/theirs/themself]" which is significantly more than 17 characters

If I remember correctly, all the extraneous stuff in brackets is just flair that you can set to whatever. It has nothing to do with your username.

1
DaPorkchop_ [any] lemmy.ml DaPorkchop_@lemmy.ml
Joined: 2023-06-02
#5 · (edited) Quote Reply

If I remember correctly, all the extraneous stuff in brackets is just flair that you can set to whatever. It has nothing to do with your username.

I know, and I am not trying to change my username. The display name is an arbitrary string which, if set, is shown in place of the username. Many users have their display name formatted like " []", but it doesn't have to be related to the username at all - I could set my display name to "aaaaaaaaaaa" or "ಠ_ಠ" if I wanted to.

I also wasn't asking how to set a display name, I know how to do that. My question was how people set their display name to be longer than 20 characters, since although that is the limit of what Lemmy allows, some users have display names exceeding the limit.

Anyway, the question isn't an issue anymore, since I figured out how the user in question managed to circumvent the limit.

1
Trying2KnowMyself [they/them/their/theirs/themself] lemmy.ml Trying2KnowMyself@lemmy.ml
Joined: 2025-12-07
#6 · Quote Reply

Hmm, I feel like I gotta clear up some misconceptions.

  1. The Hexbear account is not my alt, it’s my main
  2. Hexbear unfortunately does not allow me to define the appropriate number of pronoun forms, I’m limited to 2 pairs of 2
  3. I did not import from Hexbear and my display name is not an “accident”
  4. User tags only notify in comments until 1.0.0 (maybe not a misconception since I’m not sure if that’s even a proper tag as-is, and maybe you weren’t actually intending for me to see the post)

Congrats on figuring it out, I just vagueposted complained in my profile without bothering to try to fix things myself until a cool cat gave me a hand.

2
Trying2KnowMyself [they/them/their/theirs/themself] lemmy.ml Trying2KnowMyself@lemmy.ml
Joined: 2025-12-07
#7 · Quote Reply

Gross, it was already going away in 1.0.0 but you wanted to ruin it for everyone else early?

2
DaPorkchop_ [any] lemmy.ml DaPorkchop_@lemmy.ml
Joined: 2023-06-02
#8 · Quote Reply

Gross, it was already going away in 1.0.0 but you wanted to ruin it for everyone else early?

in retrospect, that was not a great decision. i did happen to stumble upon the bug myself, but it wasn't until your initial comment (and subsequently seeing someone discussing it in the depths of another thread) that i realized it was already well known and being used intentionally by several people, but by that point i'd already reported it and nutomic had already submitted a PR with a patch.

had i spent a few minutes actually thinking about the potential implications rather than rushing to report a bug, i would've realized that reporting it was mainly just an asshole move on my part. i've reset my display name to be within the original limits as the only form of atonement i can really do.

sorry about that :/

1
Post Reply
Back to top