Transkribus/TWI-mc

Server Error when trying to open a document the second time

jupouta opened this issue · 5 comments

Browse --> Collection X --> Document X

When choosing a document in Browse the second time, there's a Server Error on Firefox (on Chrome it seems to work fine).

Reproduced this issue and got Unauthorized (401) from Transkribus for the second call. (Open question is why it has worked the first time) This leads to the apps.utils.views.error_view(request,collections) call which brings a NameError: name 'apps' is not defined
@cziaarm think you have implemented this in all apps -> is there something missing in the library app to let it work or have I missed a required setting? Thanks!

I have a theory I think. It sort of depends on what you both understand by "second time".

I can reproduce a server error within firefox if I hit any document links before the thumbnail has finished loading.

After reproducing with django in dev mode I can see that the error it self is the one thrown by accessing the edit interface without a page number

eg https://transkribus.eu/readTest/edit/correct/1/27 rather than https://transkribus.eu/readTest/edit/correct/1/27/1

I'm guessing that this page parameter is added by javascript and that in firefox it is not added until the thumbnail image has loaded.

My feeling is that the view code should deal with the absence of a page number (by defaulting to 1) rather than requiring that it is added to the url... (one for @kansallisarkisto maybe?)

Though suspect that a the single edit view that described in https://github.com/Transkribus/TWI-mc/milestone/2 will need to act in such a way.

However my question now is where did that 401 come from @hackmanschorsch ?

BTW: This happens also if you 'Go Back' (by clicking the browser arrow) from the successfully loaded edit interface and then again hit any document - although you see all thumbs in that case.

Seems to be solved by some other code enhancement. Can't reproduce it at the moment. May @cziaarm can test this too to be sure?

Yep seems that I can't reproduce as before