keeleinstituut / tv-tolkevarav

Tõlkevärav (Translation Hub)
1 stars 0 forks source link

(FE) Handle HTTP 413 errors #578

Open thenouan opened 9 months ago

thenouan commented 9 months ago

There are a couple of endpoints where request size in bytes can be big due to the attached files. There's restriction in API layer which limits request size to 100MB and throws HTTP 413 Payload Too Large error if request size is bigger than that. All endpoints that receive files can throw this error.

TODO:

plakitkelly commented 8 months ago

Payload too large

Image

display user-readable error when received

plakitkelly commented 8 months ago

I tried to upload 7 doc (4+mb) files, didn't work

plakitkelly commented 8 months ago

I can upload only 1 file with size 1,1mb. with 2 files it doesn't work

KaarelKa commented 8 months ago

Seems to be a BE issue. Access-Control-Allow-Origin response header is missing for 413 error. @thenouan

plakitkelly commented 8 months ago

I can upload 25+ and 50+ mb files, but cannot upload 75+mb files. - Teadmata viga Today it's good that I can upload 50+mb, but in future it should be fixed

plakitkelly commented 7 months ago

I uploaded 4 files with size 25 352kB. Firstly I got an error: "server error" or smth. Then I clicked again Esita tellimus, it was successful. Then I tried to upload 5 files, got the same error: Teadmata viga. It seems that I can upload up to 100 mb. But please add better error for too large payload.

MariusJulius commented 7 months ago

@KaarelKa does it need FE work or error should come from BE still?

KaarelKa commented 7 months ago

Might need both FE and BE work. For started we need the Access-Control-Allow-Origin response header for 413 error from BE. Without it FE won't know what error we are dealing with and we can't show a reasonable error message. Once that is done, we can add the correct message from FE side as well, which should be easier than adding it from BE for this error (if I remember my discussion with @thenouan correctly)

MariusJulius commented 4 months ago

Tõlkemälud -> any translation memory -> impordi .tmx

Currently is uploading max size 1mb, so it's easy to check this..

Actual error: Failivorming ei ühildu. Lisage fail .tmx-vormingus but in dev tool I see status 413 Payload too large

Actually should be: Fail(id) liiga suur(ed). Kogu suurus ei tohi ületada 100mb - or smth

KaarelKa commented 4 months ago

Possibly fixed, but I currently didn't have a valid .tmx file with size larger than 100mb. But previously the file size error was overwritten by the generic error for tmx import. Fixed that part, so it should be fine.

plakitkelly commented 2 months ago

Tested in 20.06 - It's OK