Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LocalStorage Improvements #297

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mmulqueen
Copy link

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.

@CLAassistant
Copy link

CLAassistant commented Jul 13, 2022

CLA assistant check
All committers have signed the CLA.

@adamdehaven
Copy link
Collaborator

@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?

@ThinhVu
Copy link

ThinhVu commented Jul 1, 2023

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

@adamdehaven
Copy link
Collaborator

This PR requires some refactoring with the changes in #304

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants