lab-64 / split-the-bill-server

Backend for the Split the Bill App
4 stars 0 forks source link

159: Randomize profile image file name #160

Closed GR0ZA closed 7 months ago

GR0ZA commented 7 months ago

I encountered a problem in frontend while updating the profile image of an user due to the way Flutter handles network images. It caches the images based on the URL. Since it stays the same in the current backend implementation, the image doesn't reload after an update. Manually deactivating the cache has some mean side-effects.

Therefore the easiest and best solution I found was to randomize the file name, so that the path to the image also changes. deleteFilesWithPrefix does the cleanup.