swrv icon indicating copy to clipboard operation
swrv copied to clipboard

LocalStorage Improvements

Open mmulqueen opened this issue 2 years ago • 4 comments

We've been using the localStorage adaptor extensively for some time and it's got some rough edges, which this pull request should address. This is our patched version, we've been using it in production for over a year.

  • It checks for expiration on initialisation (swrv may not have been active while an expiration occurred)
  • It avoids an error if setting localStorage fails (as a fallback)
  • It tries to recover from localStorage being full by deleting its own cache.

To be honest, I don't think localStorage is the best tool for this because of its limitations, but it works well enough that I've not spent any time building an alternative adaptor.

mmulqueen avatar Jul 13 '22 14:07 mmulqueen

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Jul 13 '22 14:07 CLAassistant

@mmulqueen I'm planning on taking a closer look at this after the Vue 2.7 PR is merged; however, that would likely require a bit of a rewrite on this PR. Is that something you'd be open to looking into?

adamdehaven avatar Aug 11 '22 13:08 adamdehaven

Any review for this PR? We having the same issue.

ThinhVu avatar Jul 01 '23 23:07 ThinhVu

This PR requires some refactoring with the changes in https://github.com/Kong/swrv/pull/304

If someone wants to take a look, I'm happy to review

adamdehaven avatar Jul 05 '23 12:07 adamdehaven