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

when restore file is incorrect, the records of DB will cleaned #26

Closed
rezalaki opened this issue Mar 6, 2023 · 3 comments
Closed

when restore file is incorrect, the records of DB will cleaned #26

rezalaki opened this issue Mar 6, 2023 · 3 comments

Comments

@rezalaki
Copy link

rezalaki commented Mar 6, 2023

Hi sir,
I really appreciate you because of your useful library, it has helped me a lot :)

But there is a problem in restoring scenario

Please imagine the following scenario

When user wants to restore (by BACKUP_FILE_LOCATION_CUSTOM_DIALOG), suddenly he chose a wrong file (for example a PDF file)
what will happen now? the DB of user will be restated and all his old records in DB will be removed!!
So the user will lose his old data.
in this situation, the onComplete callback also shows success=true and exitCode=EXIT_CODE_SUCCESS

This is the problem I am facing right now...

The solution, (my suggestion)

I was wondering if there was a callback which could show the selected file name just before restore function invoke, would solve this problem. For example, if the selected file format is .PDF , I (as a developer) can check format via a simple IF and would not let restore function invoke.
Just a simple IF..

Finally I hope you and your useful library, the bests and lucks :)

@rafi0101
Copy link
Owner

rafi0101 commented Mar 8, 2023

Hello @rezalaki ,
Thank you very much for your inquiry. I have not thought about this scenario yet. Very good point.
I will have a look at it and implement a solution for this!

@rezalaki
Copy link
Author

Hi dear @rafi0101
Special thanks :)

@rafi0101
Copy link
Owner

Fixed in version 1.0.0-beta12
Now you can only restore backup files

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

2 participants