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

Prevent or mitigate extra whitespace in user names #1380

Open
cellio opened this issue Aug 16, 2024 · 1 comment
Open

Prevent or mitigate extra whitespace in user names #1380

cellio opened this issue Aug 16, 2024 · 1 comment
Labels
area: ruby Changes to server-side code priority: medium type: analysis Potential changes that require some design/architecture/code analysis before we start implementing.

Comments

@cellio
Copy link
Member

cellio commented Aug 16, 2024

meta:291173

We have some users with names that begin or end with lots of spaces, and there are some with expanses of spaces in the middle. This leads to confusing rendering, as shown in the linked post. When we show last activity, a user card, a history entry, a comment, etc, the user name (and its extents) should be clear.

A code-only change would be to trim the user name anywhere it's displayed (ignoring blocks of whitespace in the middle for now), but I have the feeling there's lots of code that just calls "user.name" or whatever the property is, so that'd be a lot of call sites. I don't know how hard it is to fix it at the DB level and what error checking/handling we'd need to put around that. A change like that might also annoy the affected users. Possibly a compromise would be to add a "full name" field (or some such), displayed on the profile only, seeding that with the current user names and then trimming the existing names. Maybe there are better approaches. This requires more analysis.

@cellio cellio added area: ruby Changes to server-side code priority: medium type: analysis Potential changes that require some design/architecture/code analysis before we start implementing. labels Aug 16, 2024
@ws909
Copy link
Contributor

ws909 commented Aug 23, 2024

Suggestion: before submitting the username the user input to the database, strip trailing and leading spaces, and trim every other stream of whitespace in the username to a single space.

Run a script that performs this modification on every existing username in the database.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: ruby Changes to server-side code priority: medium type: analysis Potential changes that require some design/architecture/code analysis before we start implementing.
Projects
None yet
Development

No branches or pull requests

2 participants