IITC-CE / ingress-intel-total-conversion

intel.ingress.com total conversion user script with some new features. Should allow easier extension of the intel map.
https://iitc.app
ISC License
285 stars 110 forks source link

Expire local stored data #501

Open McBen opened 3 years ago

McBen commented 3 years ago

Many plugins (stock or 3rd-party) store data on the user device. All localstorage or DB stuff will stay there forever. In a really bad case it could fill up the whole web-storage space.

It's hard to detect if a plugin is still installed and it's impossible to detect if a plugin is just deactivated for a while.

Let me propose a 'expire' date for all data?

johnd0e commented 3 years ago

Alternative solution: simple storage management plugin.

In theory your expiration feature could be easier for end-user, but I'm not sure that proposed scheme is general enough to handle all the cases in expected way.

E.g. what if I have some rarely used plugin, but still don't want to loose any data after year of idle.

johnd0e commented 3 years ago

One more idea. It would be good if we have not raw localStorage keys/values, but also some metadata, to let easily identify related plugin. It will not harm if plugin has (optional) possibility to specify expiration date as well.

mvolfik commented 3 years ago

My few bits regarding this - I'd say it's impossible to enforce plugins doing this. As we all likely know, due to the nature of the IITC plugin ecosystem, it's near impossible to deprecate things and enforce usage of new APIs in all plugins. What I think would be possible to do in this case:

johnd0e commented 3 years ago
  • make IITC storage persistent [...]
  • monitor available storage [...]

That may be good in general, but will not help with localStorage at all.