LibriVox / librivox-catalog

LibriVox catalog and reader workflow application
https://librivox.org
MIT License
37 stars 17 forks source link

Better error messages in Uploader #146

Closed twinkietoes-on closed 9 months ago

twinkietoes-on commented 1 year ago

Especially on login session timeouts, when someone has left the page open too long before uploading.

At the conclusion of the upload, they get a head-scratcher. I think the error message given is: SyntaxError: Unexpected token '<', "<!doctype "... is not valid JSON which means nothing to an average user. It would be great if we could somehow parse out the error and display meaningful messages.

notartom commented 1 year ago

Is this an existing thing, or has appeared with the Ubuntu Jammy upgrade testing?

twinkietoes-on commented 1 year ago

Existed for quite a while. Sorry for the bad timing on reporting it!

hamidsafdari commented 10 months ago

175 should fix this. I added a couple of checks to see if the request was sent through AJAX and if yes, send a JSON response. Also added a check to see if the user is logged in (only after checking for groups). It looks like in production, if the user is not logged in, he cannot see the uploader page.

146-uploader-session-timeout.webm

notartom commented 9 months ago

Closed with https://github.com/LibriVox/librivox-catalog/commit/1c0a92179477e3589939da2cbd715f5c1942ff12