-
Notifications
You must be signed in to change notification settings - Fork 388
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
Adjust username change cost #11809
Adjust username change cost #11809
Conversation
e5c3a50
to
3f281e1
Compare
3f281e1
to
965310b
Compare
tests/Models/UserTest.php
Outdated
|
||
UsernameChangeHistory::factory()->state(['type' => $type, 'user_id' => $user])->create(); | ||
|
||
$this->assertSame($user->usernameChangeCost(), $cost); |
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.
the function signature is $expected, $actual
so it should be $cost, $user->...
here (and the rest of this file).
Once someone has changed their name 5 times or more, the default cost will be $100. Now assume they wait for 4 years and then pay $8 for another name change. Shortly afterwards, they want to change their name again, but - if I understand the code correctly - now the price is back up to $100, not $16. When I first read the proposal, I interpreted the cooldown to be more "permanent". Like once you've waited long enough, you would start at tier 1 again and then "work your way back up" for each name change after that. I just wanted to ask if this is the intended behaviour. Edit: After thinking a bit about how I'd implement this, it's probably just unnecessarily difficult for the handful of people that are affected by that, so should be fine. |
yeah I think it's an oversight. A simpler logic would probably be to just set the tier to be the number of name changes over the last 4-5 years. @notbakaneko |
I guess we should wait for the oversight to be addressed before deploying to stop people getting confused. |
After going through it again, it's a lot more complicated to handle if the cost tier gets 'reset' to a new level each time. It doesn't seem practical without going through every username change in the user's history and calculating the current tier the name change should put it at, or storing the current tier. I think it might make more sense if it was based on username changes in the past X years and maybe a reduction based on when the last change was made. |
closes #11790
The new logic is the price goes up 1 tier for every paid change, and down 1 tier for every year since the last paid change, to a minimum of 1.