tnc-ca-geo / animl-api

Backend for https://animl.camera
4 stars 0 forks source link

Fix or gracefully handle `PayloadTooLargeError: request entity too large` error #149

Closed nathanielrindlaub closed 3 months ago

nathanielrindlaub commented 4 months ago

The API throws a PayloadTooLargeError: request entity too large error when content-length is > 1MB. This can happen when you try to update > 300 labels, for example.

ingalls commented 3 months ago

I did an extensive dive into how the new ApolloV4 lambda handler does body parsing and it appears as though it now removed the limit. @nathanielrindlaub is going to do some more testing to confirm but initial tests suggest that ~450 labels works fine when it used to break around 300.

The next body problem we will run into is when we hit the API Gateway limit at which point we will have to handle this behavior in the frontend.

nathanielrindlaub commented 3 months ago

Did a bit more testing and this looks good to me. We were able to update ~900 images at once with no issue so closing this out.