planktos
planktos copied to clipboard
Cleanup stale snapshots
Snapshots should automatically be cleanup when they are stale or the cleanup functionality should be exposed in the api.
In the service worker, after update() is called the old snapshots should be removed. This can be accomplished by retrieving the list of snapshots, getAllSnapshots(), and then calling remove() on those snapshots excluding the most recent snapshot.
@xuset @alvin319 Shouldn't this be handled in update? I thought we were looking to depreciate the snapshots interface from Planktos?
For it to be handled in update() the interface has to change first which seems out of scope for this issue
I'm not sure I see why the interface would have to change? The update function gets the latest snapshot, so it could just delete all the other ones after it finishes storing the new snapshot.
The existing interface doesn't make sense when there can only be one snapshot. getAllSnapshots and removeSnapshot are pointless when there is only one snapshot