-
Notifications
You must be signed in to change notification settings - Fork 4
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
IndexedDB instance on Web is not persisted #73
Comments
The counter persists for me on that sample in both Safari and Chrome. Am I supposed to be seeing something different? |
It's an issue when adding packages and re-deploying (then the cached state is lost) but I think it has something to do with the default Flutter service worker. I added more context in the linked bloc issue. When I disabled the service worker ( In general though it might be nice to document how hive_ce will handle persistence on web (what the durability is and whether the database will be guaranteed to be persisted or not). It seems like the database is not guaranteed to be persisted and as a result it's probably not suitable for cases when the application relies on stored data being there in subsequent loads. |
I think that "Is persistent" field is related to this: https://developer.mozilla.org/en-US/docs/Web/API/StorageManager/persist Maybe I could try enabling it in hive? Web data in general is not guaranteed to persist |
Try this code and see if anything changes: #74 I can't get persistence to enable on localhost, but maybe it works on a deployed site |
Steps to Reproduce
See felangel/bloc#4335 for detailed reproduction steps.
I believe this is because the underlying IndexedDB instance is not configure to be persistent.
You can see a sample at https://flutter-firebase-auth-2b1c3.web.app.
Version
The text was updated successfully, but these errors were encountered: