ing-bank / lion

Fundamental white label web component features for your design system.
https://lion-web.netlify.app/
MIT License
1.75k stars 293 forks source link

Lion-input-file should revoke created object URL's or dev should be warned that they might need to revoke the URL #2269

Open Joel-Levi opened 5 months ago

Joel-Levi commented 5 months ago

I am using the lion-input-file for the image upload part of a rich text editor. The page this editor is on can be open for a long time, say an entire day.

When choosing a file using lion-input-file an object URL is created in the FileHandle. This object URL is never revoked within lion code, which means there is a memory leak happening.

I am not sure if the component itself can know when the URL may be revoked. If the revoking of the URL cannot safely be done in the components that are using the FileHandle class, developers should be informed that they might need to revoke the downloadUrls themselves.