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

infinite loop / browser hanging #41

Open
nicks opened this issue Jun 8, 2021 · 0 comments
Open

infinite loop / browser hanging #41

nicks opened this issue Jun 8, 2021 · 0 comments

Comments

@nicks
Copy link

nicks commented Jun 8, 2021

Thanks for this library!

We use the useStorageState hook to persist some state to local storage while the user is typing, so we can restore it on refresh.

Recently, we received a report that when they typed, the browser locked up and had to be restarted. They're not able to reproduce it reliably, and we haven't been able to reproduce it easier.

I was able to reproduce it synthetically by adding

window.localStorage.setItem = () => {
  throw new Error('my error ' + Date.now())
}

where this library goes into an infinite loop trying to handle the error (even if you're not writing to local storage). This might be a red herring, or might be the root cause.

Thoughts?

Downstream issue: tilt-dev/tilt#4618

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

No branches or pull requests

1 participant