-
Notifications
You must be signed in to change notification settings - Fork 157
Reload database when extracting database over it #704
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
Conversation
Still clears archivemodel for some reason
No race condition after all, it was caused by the bottom archive being selected which doesn't have the archive model data, creating the appearance that the archivemodel got cleared. |
I think I can do this differently through renaming the db on restarting Vorta. |
Codecov Report
@@ Coverage Diff @@
## master #704 +/- ##
==========================================
- Coverage 70.32% 70.07% -0.25%
==========================================
Files 56 56
Lines 3791 3820 +29
==========================================
+ Hits 2666 2677 +11
- Misses 1125 1143 +18
Continue to review full report at Codecov.
|
Should always trigger on db extract, breaks if we ever change database name. Will trigger if any filename contains "settings.db", I just don't want it to trigger every time since reloading all tabs might be slow.
Since disagreement == too heated now, are you going to merge this or should I just not bother? |
I wont merge this because:
Sorry if you did the work for nothing or disagree with the above. As mentioned in the contributor docs, it’s best to discuss new features before actually coding them. I realize that choosing features based on incomplete information will be opinionated. I dont have a better way right now. Using Github Discussions with the upvote feature is an attempt to make it more democratic. |
I don't find a crash during an operation (extract) acceptable. What solution do you propose to prevent crashing when extracting settings.db? |
Also, during an extract, most time is taken by disk IO. CPU time is not a limiting factor. |
I did an experiment, comparing speed with and without. Setup: My conclusion is that there is very to no difference on time one if statement will do to extraction speed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't find a crash during an operation (extract) acceptable.
This only runs for extract commands only, filtering out for only settings.db. As long as settings.db is called settings.db there is no problem.What solution do you propose to prevent crashing when extracting settings.db?
Just don't overwrite the files of an active program. 😄 Can you remove your Chrome/Firefox profile while using it? Why would this be a feature?
@@ -252,6 +253,12 @@ def get_misc_settings(): | |||
return settings | |||
|
|||
|
|||
def connect_db(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason to not have init_db()
only?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bump. Is connect_db()
even needed? Why not move it all to init_db()
? For tests?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I tried to remove it and it broke the tests. I could try to change the test code, but based on past experience changing it makes things worse.
For a web browser that only really writes to a downloads folder, yes it would make sense to crash. This is not really a feature, its fixing a bug where: |
Turns out this breaks the tests This reverts commit 3029328.
We can't support this because you can't do a restore of your home folder while logged in. You need to log in as root, restore I'm sure you got it working for Vorta's DB, but what if users overwrite other files they have open? |
If restoring a home folder, its typically from a blank slate, with no other programs open other than maybe a web browser and terminal. Firefox actually handles restoration well, they put each profile in a folder with a random name to prevent crashing, and read a file to determine which one to use. I could do that instead of reloading everything. On startup: On extract db: |
Restarting isn't enough. As long as you have a desktop env going, files will be used. The steps to restore a full home folder are:
If you think I'm lying, please get a second opinion. We won't encourage anyone to overwrite their home folder, while logged in. Restoring may work for a simple Linux desktop without much stuff open, but it will cause problems on macOS for sure. Even if Firefox uses a random profile name, the backup you did before will still use the same name. They don't do it for that. |
The original issue was done in Linux. |
Sounds like this mostly solves your own problem. Problem is that eventually you will move on and then I'm stuck maintaining your code that doesn't serve anyone and that I can't remember why it's there. Myself, I sometimes rename |
Additionally, Windows backup software does not have this issue. It just restores the data. No other accounts needed. Going to repeat my point: You can't "train" people by having Vorta crash, they'll just file another bug report and get annoyed at the software. |
Please accept that I don't want to merge such a feature. Arguing here is very tiring and I'd rather do something productive while working on this project. |
Just remember, I am a volunteer. |
No disrespect, realize you are a volunteer, but you are on the wrong side of this. The whole point of Vorta is not to just make a Linux nerd's job easier, its to allow people migrating over from Windows be able to use a powerful backup/restore engine in an easy-to-use way, so that its not impossible for them to use it. Your justifications are not valid. No developer should ever advocate for the purposeful crashing of the app and try to write it off as a training issue. To be blunt, that's just bad programming. Your program should always handle all edge-cases. Always. Please reconsider, even if it means you have to "remember" the patch for any new work later down the line. That's part of the job description for a programmer, and I would hope that the person creating the patch would include documentation in-line to help out with any future bug fixes. And finally, you really want to have Windows do something that Linux can't? Really? Apologies if the above seems harsh, but like I said, you are really on the wrong side of this and are just arguing so that you do not have to do work. If you were a paid employee, that would get you fired. Since you are not paid, its totally in your sphere of control to decide what Vorta means and how it and you perceived by others. Take care. |
Is today attack-the-maintainer-day? I know that you think you commented with best intentions, but if you want open source to improve, you'd be advised to stop. |
We're not arguing to save our souls, but yours. Defending open source through bad decision making does not support open source. Its about making products that expands the usage of software to the masses, not justify enclosure by the elite. NO programmer should justify the crashing of an app as a 'training issue'. Open or closed sourced. |
Still clears archivemodel for some reason, need to fix that.
Edit: It happens only sometimes. Probably race condition.
Fixes #703