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

Varchar limits are probably too low and/or need better enforcement #26

Open
MoralCode opened this issue Mar 17, 2023 · 2 comments
Open

Comments

@MoralCode
Copy link
Owner

MoralCode commented Mar 17, 2023

display_name = db.Column('bell_schedule_display_name', db.VARCHAR(length=75))
as an example of the one that was causing issues (edit: its the 20 character limit on BellScheduleDisplayName thats causing issues)

it seems this is currently being enforced/caught at the sqlalchemy layer by as a DataError. which is probably a dumb way to do it

pending further evaluation and root-causing as the affected column ((mysql.connector.errors.DataError) 1406 (22001): Data too long for column 'bell_schedule_display_name' at row 1) wasnt being given a string that was too long (only 27 ASCII characters). This will also likely require a schema change

@MoralCode
Copy link
Owner Author

Sentry incident refs: CLASSCLOCK-API-7 CLASSCLOCK-API-9

can confirm this crash is replicable when the display name is too long (such as "this is a really long display name for testing purposes")

@MoralCode
Copy link
Owner Author

added client side validation in MoralCode/ClassClock@47ffde1 to make this less likely to happen. still needs to be fixed at the schema level though

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant