-
-
Notifications
You must be signed in to change notification settings - Fork 99
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
feat: use display_name everywhere #3017
base: master
Are you sure you want to change the base?
feat: use display_name everywhere #3017
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Going to stop here for today. Have not tested public or connect APIs yet.
public/dorequest.php
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
achievementwondata
, getfriendlist
, lbinfo
should be modified to return DisplayName
in addition to User
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've made these changes in latest - please give them an extra look. While I've tested these changes, I'm not 100% confident in them. Just want to be extra sure we're okay surfacing the username in all of these.
I've made a change in user-auth.php such that u
now accepts both User
and display_name
.
achievementwondata
, getfriendlist
, and lbinfo
have all been modified to return DisplayName
values, ie:
"Entries": [
{
"User": "Bkid",
"DisplayName": "Bkid",
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've made a change in user-auth.php such that u now accepts both User and display_name.
I think we want the user to always log in with their username, don't we? The problem I reported earlier was that since DisplayName was being returned by the login API, future calls passed it as the user's Username.
Did we change the web login to support display name?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, logging in on the site via display_name should already work on this branch.
I figured once a user sets a display_name
it would probably be very counterintuitive for them to log in with their original username. For the Connect API it's probably less of a concern past the initial emulator login call, so I'd be happy to revert that if you think we should.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If they can log in to the site using their display name, they'll expect to be able to do so from the emulator too. I was under the impression that the User name was still part of their credentials, and the display name was just something that should be public-facing. Hence, my concerns about still exposing the Username through the avatar images on the webpages.
rcheevos uses the User
value returned from the login call as the u
parameter for all future calls, so it seems unlikely that the display name would be passed to any of them unless there's some client not using and not mimicking rcheevos.
I guess it doesn't hurt to check both.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Implemented number 3 in latest. To reiterate, this means:
User
is overloaded with the user'sdisplay_name
inlogin2
,achievementwondata
,getfriendlist
, andlbinfo
.AvatarUrl
has been added to all four of those.
I also see we have codenotes2
. This is currently returning User
and DisplayName
- I assume this is used by the toolkit only - not sure if this should be changed or left as-is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also see we have codenotes2. This is currently returning User and DisplayName - I assume this is used by the toolkit only - not sure if this should be changed or left as-is.
rcheevos is only processing the User
value, and returning it as author
. The only thing the toolkit uses is for is the warning that you're overwriting someone else's note. So, I think it's reasonable to return display name there too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've verified this is happening in latest:
{
"User": "WCopeland",
"DisplayName": "wesweswes",
"Address": "0x0001a0",
"Note": "[8-bit] Total Lives Remaining\r\n\r\n02 = Two lives remaining\r\n00 = Player is on last life (not game over)\r\nFD = Game Over \/ Password screen\r\n\r\nSymbol: lives"
},
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I meant "I think it's reasonable to return display name [in the User field] there too".
Then all the APIs will be overloading User with the display name, and provide an AvatarUrl where we expect the client might want to display one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
…opeland/RAWeb into use-display-name-everywhere
Pre-deploy SQL:
This PR is a precursor to username change functionality. A subsequent PR will add a new panel to the Settings page for users to request a username change, and a new tool in Filament for moderators to approve username changes.
This PR makes the
display_name
field a first-class citizen on the site, having everywhere a user's name is displayed prefer it overUser
if a user'sdisplay_name
value is non-empty.I have tested:
display_name
instead of username, reset password, etc.).Even though my manual testing has been extremely exhaustive, I have no doubt there are things here and there I may have missed. However, with the volume of users who are asking for username changes, I'd like to get this functionality done sooner rather than later.
Implementation notes:
display_name
is "wes". This implementation allows you navigate to/user/WCopeland
and/user/wes
. This does not currently have a self-healing redirect (I don't think this is desirable until the respective pages are converted to React). In other words,{user}
's resolution logic is$user->display_name ?? $user->User
.How to test this PR:
Set your
display_name
value to anything that would be a valid username (min 3 chars, max 20 chars, no special chars). Perform any action anywhere on the site as you normally would.Next steps:
UserAccounts.display_name
non-nullable.