Description
Yesterday using our software, based on RXDB with RXServer (Express) as backend, on a bigger live event than before, we suddenly experienced failed synchronizations. All the affected client was receiving was 413 Request entity too large
. A look at the backend logs revealed, it was continuously throwing nodejs PayloadTooLargeError: request entity too large
errors. Looking for the cause, it seems express limits json parsing by default to 1mb.
So as a dirty workaround, in RxServerAdapterExpress
, create()
, I changed app.use(express.json());
to app.use(express.json({limit: '500mb'}));
and thing recovered.
Once app.use(express.json());
is called in the RxServerAdapterExpress
function, further calls with different options are ignored.
Since (as far as I see), there currently is no possibility to give custom options to the Express adapter, what would be you're preferred design (@pubkey).
Or is there a (to me unknown) option on the client side to restrict the payload size?