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

Added unique name check to set name command. #1713

Merged
merged 2 commits into from
May 7, 2023

Conversation

dmccoystephenson
Copy link
Member

We were checking for unique names when a faction was created, but not when it was renamed via the set name command. The changes in this PR add a unique name check to resolve this problem.

This was tested locally on a 1.18.2 spigot server.

closes #1706

Copy link
Member

@renbinden renbinden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems adequate for most cases.

It may also be worth adding a unique constraint at the DB level in a migration, as if two players ran the command at exactly the same time, the query to update the faction is run async so both might succeed. That's absolutely an edge case though.

@dmccoystephenson dmccoystephenson merged commit adfe5e9 into release/v5.1 May 7, 2023
@dmccoystephenson dmccoystephenson deleted the rename-unique-name-fix branch May 7, 2023 23:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants