observablehq / feedback

Customer submitted bugs and feature requests
42 stars 3 forks source link

Clear localStorage of old commits #476

Open visnup opened 2 years ago

visnup commented 2 years ago

Describe the bug When the socket disconnects, we save edits to localStorage. When it reconnects, we replay them if our versions are still up to date. If the version isn't up to date, we currently leave them in localStorage forever. localStorage is limited in how much you can store depending on browser. When it fills up, this mechanism may fail.

To Reproduce Steps to reproduce the behavior:

  1. Open a notebook you can edit.
  2. In devtools or similar, go offline.
  3. Make some edits.
  4. In another tab or browser, make other edits to increase the version.
  5. Come back online.
  6. In devtools, check localStorage contents and see a notebook-next-* entries

Expected behavior Very old or highly unlikely items can be safely deleted or garbage collected at some point.

Screenshots

image