Cryptizism/dynamic-tier-list

Site crashes at LocalStorage capacity

Closed this issue · 2 comments

Currently there is no fail safe option for when LocalStorage exceeds capacity. Images are stored in the full definition in which they were provided. They are then encoded into base64 and stored in LocalStorage.

Solutions:

  • Change LocalStorage for IndexedDB as it's capacity is the available disk space
  • Add a fail safe and downscale images

Challenges:

  • Structure of IndexedDB makes it harder to port easily
  • IndexedDB uses asynchronous operators whereas LocalStorage is synchronous

Downscaled images: 0e1d46b

benchmarked at handles 300 images, will mark as will not fix as alternative solutions kind of suck