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

Update available/reload causes data loss #354

Open
petele opened this issue Nov 29, 2018 · 4 comments
Open

Update available/reload causes data loss #354

petele opened this issue Nov 29, 2018 · 4 comments
Labels
bug Something isn't working UI UI related issues

Comments

@petele
Copy link
Contributor

petele commented Nov 29, 2018

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.

@jakearchibald
Copy link
Collaborator

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.

@surma
Copy link
Collaborator

surma commented Nov 29, 2018

How does SessionStorage work wrt. Page Lifecycle API. If SessionStorage is memory only, will we lose content on mobile if a page gets frozen?

@jakearchibald
Copy link
Collaborator

jakearchibald commented Nov 29, 2018

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 😀.

@surma
Copy link
Collaborator

surma commented Nov 29, 2018

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

@kosamari kosamari added bug Something isn't working UI UI related issues labels Dec 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working UI UI related issues
Projects
None yet
Development

No branches or pull requests

4 participants