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

loss of data after app crashed/exited forcibly #170

Open
MichaelSowah opened this issue May 27, 2020 · 5 comments
Open

loss of data after app crashed/exited forcibly #170

MichaelSowah opened this issue May 27, 2020 · 5 comments

Comments

@MichaelSowah
Copy link

A user reported that all his local data was lost after he interrupted online uploading of local data and app wan exited forcibly.

is that supposed to happen?

@alextekartik
Copy link
Collaborator

I am not aware of such issue but data corruption is not something easy to test. Alternatively, if you don't trust sembast io format, one solution is to use sembast_sqflite (the notepad example uses it) which stores data in a sqlite file instead of a plain json file.

@MichaelSowah
Copy link
Author

I am not aware of such issue but data corruption is not something easy to test. Alternatively, if you don't trust sembast io format, one solution is to use sembast_sqflite (the notepad example uses it) which stores data in a sqlite file instead of a plain json file.

sembast_sqflite looks pretty interesting, you are doing quite an amazing job, I guess all I have to do is switch my package to sembast_sqflite and I dont have to change any of my querries

@alextekartik
Copy link
Collaborator

I guess all I have to do is switch my package to sembast_sqflite

sembast_sqflite depends on sembast so you can keep sembast. Basically it is just a matter of having the good 'factory' and 'name' to open a database. after that database and queries are the same. The notepad example uses sembast_sqflite on mobile and sembast_web on flutter web. Conditional imports can be used for this (see an example - the one used by the notepad example - here https://github.com/tekartik/app_flutter_utils.dart/tree/master/app_sembast/lib/src)

@godwinjk
Copy link

I am getting this issue occasionally. Try to record data on mainStore and force close the app. Again retrieved the data using same key.

Almost all time getting null from recrord.

@ankiimation
Copy link

have the same problem, switched to sembast_sqflite solved the problem for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants