-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Update available/reload causes data loss #354
Comments
I was thinking about this earlier whilst talking a shower. Session storage is the right place for this stuff, but it only takes strings, which is stupid. I guess we could base64 the content, but we may run into storage limitations. My understanding is most browsers place septate limits on local/session storage to IDB etc. |
How does SessionStorage work wrt. Page Lifecycle API. If SessionStorage is memory only, will we lose content on mobile if a page gets frozen? |
Ugh it's a tough one. The examples in the spec suggest that session storage persists beyond tab freezing and maybe even crashes. Unfortunately the HTML spec contradicts this WICG/page-lifecycle#26. I think the Chrome implementation keeps session storage around though. We covered this in a recent http 203 episode btw 😀. |
I know ^^ but I wasn't sure about the interaction with Page Lifecycle. I think we should start with SessionStorage and see if we can get away with it. If we can avoid persisting to disk it's #winning |
Describe the bug
Opened Squoosh, dragged an image on, and got the "update available, reload?" toast. Hit reload, and I lost all my work. I should be prompted to either save my work, or told that I'm about to lose my work.
The text was updated successfully, but these errors were encountered: