Drift is supposed to persist for web, right? (Database clears when app stops and runs) #3136
-
I just wanted to confirm that Drift is supposed to work and persist for web since I've been troubleshooting for a while now and gone through the web section many times. I've tried with my personal app and some of the example apps. When I run the apps in chrome on web, the data will persist when I refresh the page, restart (Ctrl + Shift + F5) via VS Code, or if I "Save and Hot Reload." However, if I stop (Shift + F5) then run (F5) again, the data will be gone and any data I input will start over from scratch with a primary key of 1. I don't have this issue when I run on Android - the data will persist after restarting, and after stopping and starting. I get the following error on chrome: Am I missing something here? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Drift is supposed to persist data on the web, yes. And since it works when refreshing the page, I assume it is.
It's possible that Flutter sets up a new Chrome profile when you do that (which would delete all data from the previous session), is other data (like shared preferences / |
Beta Was this translation helpful? Give feedback.
Drift is supposed to persist data on the web, yes. And since it works when refreshing the page, I assume it is.
It's possible that Flutter sets up a new Chrome profile when you do that (which would delete all data from the previous session), is other data (like shared preferences /
window.localStorage
) also gone?