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

Validate changelog lengths #508

Merged
merged 3 commits into from
Aug 21, 2024

Conversation

HebaruSan
Copy link
Contributor

@HebaruSan HebaruSan commented Aug 21, 2024

Problem

  1. Click Update for a mod
  2. Enter a changelog longer than 10000 characters
  3. Click submit
  4. You get a 500 Internal Server Error

Cause

The SQL column has a length limit, but this limit is not checked in the Coffeescript or Python code, so it is only enforced at the very end of updating when we try to create the SQL row.

Changes

Now the changelog length is checked on the client and on the server, and a user friendly error message is generated if it's too long. I believe this will happen before the upload starts, so the user won't have to wait for their 5-GiB ZIP file to transfer fully.

@HebaruSan HebaruSan added Type: Improvement Area: Backend Related to the Python code that runs inside gunicorn Priority: Low Status: Ready Area: Frontend Related to HTML, JS, CSS, or other browser things Scope: Trivial Simple changes that should be easy to develop and review labels Aug 21, 2024
@HebaruSan HebaruSan merged commit 2728b7f into KSP-SpaceDock:alpha Aug 21, 2024
3 checks passed
@HebaruSan HebaruSan deleted the fix/changelog-len-err branch August 21, 2024 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Backend Related to the Python code that runs inside gunicorn Area: Frontend Related to HTML, JS, CSS, or other browser things Priority: Low Scope: Trivial Simple changes that should be easy to develop and review Status: Ready Type: Improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant