[Html2PdfConverter] Bug in PDF generation

[Html2PdfConverter] Bug in PDF generation

Forge Component
Published on 30 Oct by Guilherme Pereira
52 votes
Published on 30 Oct by Guilherme Pereira
Hi all,

A bug was found on this component. 

Found scenario:
Two users call at the same time for two different pdf's to be generated. Both retrieve the same pdf binary. 
This is a very serious bug if you have a multi-tenant application with high usage from users, because it may discredit the multi-tenancy capability from the OutSystems platform.

This situation occurs because the generated random name for the temporary pdf file only takes into account the timestamp. If two requests have the same timestamp, only one temporary file will be created because the other one will be overwritten.

The temporary filename random method should take more factors into account besides the timestamp. 
Eg. (Hashing the input URL, quantity of memory available for the garbage collector, etc)

Thank you. 

Hi Rui,

Thanks for the feedback.Eventhough quite rare this is indeed a possible scenario.
To help prevent it but keeping it simple I've released anew version and included a random GUID on the filename that should prevent such scenarios.


Hi Guilherme,

nicely done!