Skip to content

Add user-facing validation for DB-enforced length limits of string properties #38

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

Merged
merged 2 commits into from
Feb 25, 2025

Conversation

bdach
Copy link
Contributor

@bdach bdach commented Feb 24, 2025

Closes #37.

Similarly to #36, this won't make the submission not-fail, but errors won't get reported to sentry and users will get better feedback about why their map won't upload.

This also moves the romanised validations from #24 to the built-in data annotations machinery as it's honestly just easier to not reinvent the wheel, and the declarativeness of the syntax is also nice. There is one tradeoff however in not being able to print the values that get validated out which isn't great.

The limits were taken from my local db which is what osu-web sets up so it may be a good idea to double-check these against production.

…operties

Closes ppy#37.

Similarly to
ppy#36, this won't
make the submission not-fail, but errors won't get reported to sentry
and users will get better feedback about why their map won't upload.

This also moves the romanised validations from
ppy#24 to the
built-in data annotations machinery as it's honestly just easier to not
reinvent the wheel, and the declarativeness of the syntax is also nice.
@bdach bdach self-assigned this Feb 24, 2025
@peppy peppy merged commit a38f1ae into ppy:master Feb 25, 2025
4 checks passed
@bdach bdach deleted the string-length-limits branch February 25, 2025 06:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MySqlConnector.MySqlException: Data too long for column 'filename' at row 1
2 participants