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

Catch and display upload errors #255

Merged
merged 2 commits into from
May 13, 2020

Conversation

DasSkelett
Copy link
Member

@DasSkelett DasSkelett commented May 12, 2020

Problem

Currently most of the errors you can encounter while/after uploading mods are "swallowed".
These are for example problems saving a zipball due to the reoccurring storage problem, an invalid zipfile, internal server errors and so on.
What happens now is that error messages are actually returned by the server/api, but the client/frontend is not able to display them (or better, throws an exception trying to display them), and thus the frontend stays in an incomplete state, where the user can't see what actually happens or already happened behind the scenes. It appears to load infinitely, as often reported in the forums.

Solution

The JavaScript code is re-ordered to
first check if there's a valid JSON response by the server,
a) if yes, check if result.error is false
a.a) if yes, everything's fine! Upload succeeded, redirect to the main mod page.
a.b) if no, take the supplied error message and show it.
b) if no valid JSON is given, this means that it's probably an connection error to the server or the backend threw an error handling the upload request.
We check the returned status code and show a more or less appropriate message.

It should no longer load to infinity after errors, instead a message should be shown, and the user can act based on it (in the best case, they inform us...)


I also extended the upload backend code a bit to catch IOErrors when trying to save the zip file and return a more direct message.
I hope this is the one that is returned when the samba storage locks up again.


The Dockerfiles were version-locked down to the patch level, and were often already pretty outdated. I removed the patch part, so that they auto-update a little bit, within the given minor version.
Doesn't affect prod/beta/alpha, since we don't use the Docker containers there, so only local dev envs.

@DasSkelett DasSkelett added Type: Bug Area: Backend Related to the Python code that runs inside gunicorn Priority: Normal Area: Frontend Related to HTML, JS, CSS, or other browser things labels May 12, 2020
@DasSkelett
Copy link
Member Author

I might have found something regarding #250, merging this PR now to maybe get some more information.

@DasSkelett DasSkelett merged commit 1b94420 into KSP-SpaceDock:alpha May 13, 2020
@DasSkelett DasSkelett deleted the fix/catch-upload-errors branch May 13, 2020 22:12
@HebaruSan HebaruSan mentioned this pull request Jun 28, 2020
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: Normal Type: Bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant