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

Handling DOMStateStorage failures #123

Closed
mjackson opened this issue Nov 2, 2015 · 5 comments
Closed

Handling DOMStateStorage failures #123

mjackson opened this issue Nov 2, 2015 · 5 comments
Labels

Comments

@mjackson
Copy link
Member

mjackson commented Nov 2, 2015

Currently, we just warn when calls to DOMStateStorage's saveState and readState fail. However, warnings don't really seem right here since the app will be broken.

One idea I had is that we could possibly fallback to using window.name for session storage instead of window.sessionStorage. The main limitations here would be:

  • possible conflicts with other libraries using window.name. This is highly unlikely since window.name is a really obscure API, but we'll definitely want to put a caveat in the docs so people at least know about it.
  • size. It looks like we're limited to 2MB.

Thoughts?

Edit: This is a follow-up to #120

@kentcdodds
Copy link
Member

FWIW (probably not much), the angular project uses window.name as a place to store some debugging related state (defer bootstrap and debug info).

@mjackson
Copy link
Member Author

mjackson commented Nov 2, 2015

Whoa, great catch @kentcdodds. Thanks for pointing that out. Can you help me understand how people use that? Is it mainly for dev?

@kentcdodds
Copy link
Member

Pretty much soley for dev

@kentcdodds
Copy link
Member

Basically, for perf, angular has the ability to disable dev related info. Useful for production deploys. But when you need to debug a production app, having that debug info is helpful. But you need a full page refresh to turn it on. So to store state across the page reload, angular uses window.name.

@mjackson
Copy link
Member Author

mjackson commented Mar 9, 2016

Gonna close this until one of us finds time to work on it.

@mjackson mjackson closed this as completed Mar 9, 2016
@lock lock bot locked as resolved and limited conversation to collaborators Jun 5, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants