-
Notifications
You must be signed in to change notification settings - Fork 75
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
KVIrc fails to save and restore settings sometimes #1744
Comments
Here is what Ive noticed/observed (while testing other somewhat related issues) No settings are being written to file in user config directory as you change/apply something, things seem to be held in memory and then somehow (if you're lucky) when you close KVIrc things maybe then saved. You can test this yourself easily; (this is what happens here in Linux anyway I presume Windows behaves the same?)
My guess is that the settings being held in memory are lost somehow, no idea really how to fix. |
Sounds like options saving should be moved to an event triggered system then? |
afaik kvirc does not save settings automatically when you change them, they are flushed from time to time and when you quit the application. So if you forcibly close kvirc, they are not saved, of course... |
Yeah would make sense then to flush them when the options window closes, imo |
imo it makes sense to save soon as apply is pressed and config files reloaded, if thats what you said means. |
Unless KVIrc itself writes things to the settings while it's running, I agree that it makes more sense to just save them when OK/Apply is pressed. |
In any other softwares OK never saves anything its more or less behaves like close, apply is when things should be saved, in any case as its done currently is unstable and prone to failure, even though I havent quite experience the degree of chaos the OP describes. I would even make apply greyed out unless a change happens, when you chnage something button comes active to confirm visually that something has changed, once pressed it should grey out again. (Ive no idea here anyway this is just academic discussion to me. |
No. You're describing Cancel, not OK. |
OK here does nothing to save anything. Pressing OK closes the window. also if I change some setting it definitely doesn't change anything for the related setting even on Kvirc reload. at least that what I observe here. |
@Stanzilla can you try to run |
https://github.com/kvirc/KVIrc/blob/master/src/modules/options/OptionsDialog.cpp#L621 |
Yes. g_pApp->saveConfiguration() runs when OK is clicked in the options dialog. |
It happens when Windows closes KVIrc when it tries to shutdown. I can repro it 100% with that. If you have the setting to require confirmation on quit enabled, the shutdown will be blocked and you won't run into this though. |
The porblem is that settings arent written to disk until you close kvirc, else things are left in memory, something happens to that memory and poof, gone. @staticfox noted that on IRC and this is a real issue hence added to blocker milestone. |
This is still happening and it is becoming very frustrating. The other day when I restarted my pc, kvirc's theme and position and windows size were all reset to default. Setting the theme back to the theme I use, some of the theme's settings were missing. Today I just lost all of my auto-login information, so now I need to set all that up again. How is this even happening? How does kvirc manage to seemingly randomly remove sections of, or entire files? Why is it even touching these files to begin with? |
@karai17 what OS are you using and are you using a recent nightly or an old release? |
I am running Fedora 24 and using whatever is in the Fedora repos. It is Landon Manning On 15 November 2016 at 01:46, IceN9ne notifications@github.com wrote:
|
it still happens on Windows, too btw. |
If the settings were saved, then a crash will not cause the settings to be "lost". Settings are saved when you click ok/apply. If settings are changed after you come back from a crash or forced close, then either the wrong settings are being loaded on next run, or something in KVIrc is overwriting the settings on load (as if it's first run?). |
Can you check the settings (maybe create a backup), force a crash (or whatever it is to cause this issue), and then before you open KVIrc again, manually check the config to see if it's what you expect? Pick a few of the ones you say are always changed. Also, what are they always changed to (I.E. are they always reset to KVIrc defaults)? |
@Stanzilla That way they can be compared usefully. |
I can't repro anymore. Either the issue is gone or KVIrc has to go into a "bad" state before it happens. |
Reported on IRC as "still happening" |
This is not fixed. It still happens in current builds on Windows. The only hack that helps is to make the config directory write-protected, which then generates an error message whenever closing KVIrc, but it can no longer destroy its own files. Apparently, KVIrc shoots into its own foot when it is requested to close by the OS. Maybe it kills the thread that writes the files, or something like that. However, it is insane to save settings on closing anyway, regardless if they were changed or not. If this behaviour was changed to "save when changed", the issue should be gone in 99% of the cases. |
The only person to state what settings were lost was Stanzilla who confirmed that the only settings he lost were ones he changed outside of the Configure Settings/Theme dialogs and didn't properly close KVIrc after changing them. I looked at the code, and this situation is inline with how the code is written. However, for losing settings due to a failed write, nobody has ever showed any corrupted .kvc files, stated which settings were lost due to such a failed write, or any other statement other than over-generic claims with wild assumptions. |
It does not depend on the close after the change. It happens also when nothing changed, and the OS asks KVIrc to close. Stanzilla described exactly this behaviour.
This varies. Sometimes its the theme, sometimes its the alternative nicknames, sometimes its the "don't show this window again" option. The last time I had the issue, KVIrc forgot its entire server database.
Really? It is not a wild assumption that KVIrc constantly writes files which don't need to be written. Just look into the code (KviApplication::~KviApplication())... |
Give examples of what the config file looks like after such a situation occurs so that we can tell if it's a failed write or some other issue. Without confirmation, it's likely this issue will never be fixed. You're assuming the cause without any proof. |
It's not a problem that KVIrc is writing files that don't need to be written. The problem is when those files get corrupted. |
I'd still love to see an example of such a mythical corrupted file. |
I'm on vacation atm but I can try again when I get back home. I always did the same to cause it, just shutdown Windows while KVirc is running and let it kill it this way. |
It is a problem that KVIrc writes unhanged data, however it is not the "root cause" of the data loss. The data loss can also happen when the files are saved because they were changed. But writing them much more often than necessary increases the risk of loss (apart from other considerations like performance and SSD lifetime), so yes, I would consider this as a "problem" itself. Anyway, I will temporarily remove the write-protection, and try If I can generate a broken file. |
I personally haven't run into this issue despite closing KVIrc through Windows shutdown quite often. But only saving the config files when actual changes occur is probably a good thing to do. |
"Saving the config file when actual changes occur" would require almost a complete rewrite of the settings system. The way it was originally written requires the files to be committed on close. |
I would pose that idea that committing on close is faulty design and that a complete rewrite, if necessary, should be done. It is infuriating when I change a setting in any program, and then if the program doesn't close properly, that setting is lost. Commit it when I click "Apply" or "OK" or "Save" etc, that is the most sensible thing to do. |
Here it is, main.kvc consisted of just one line this morning: KVIrc still knew which channels to enter, but it forgot to hide some windows and it forgot its themes and several other settings. After closing KVIrc again, it was filled with default settings. |
Bit of a shot in the blue: Maybe the saving procedure can quietly fail at any of those steps? (unchecked error returns and such) |
It also appears to me that a failed writable check can lead to a file such as @PKEuS described above: KVIrc/src/kvilib/ext/KviConfigurationFile.cpp Lines 343 to 351 in 96ca5fb
The close might also need checking maybe? |
As this issue just happened again to me (this time, the entire server list was flushed), and I am now once more forced to reconfigure each and every server I connect to, I just want to let you know: I am tired of it. I will switch to a different client after using KVIrc for more than 10 years. I need an IRC client that is reliable and that does not need a write protection flag on its settings (causing an error message on closing - just as annoying as reconfiguring the entire client every two or three weeks). Closing the IRC client must not be a dangerous action. Even though if this means that I basically loose all my IRC log files (or at least a convenient way to read through them). |
In the same boat here. I rebooted into safe mode to fix a GPU driver (DDU) and when I booted normally again KVIRC had "forgotten" its configuration once again. Very tired of reconfiguring the client from scratch. In this case my main.kvc and serverdb.kvc files are NOT empty, yet all of the other .kvc files are and KVIRC loads to a blank white window. At this point I'm done, I won't configure KVIRC again. |
Check out #2417 . It may have fixed the issue. Reopen if it still persists. |
Recent issue so probably maybe a regression: Sometimes when restarting the PC or logging out, KVIrc loses certain settings, like which theme was selected and on/off toggles for some settings. This never happened until ~1-2 week(s) ago.
I could make a list of which settings it loses (it's always the same) but not sure if relevant?
Examples on what is lost:
Also when I closed and reopened it after changing all the settings again it kept those, yet after the next "crash" it lost exactly those again.
There is at least one other user having the same issue on #kvirc. Just creating an issue now so I don't forget and can maybe add more details as I figure them out later on.
The text was updated successfully, but these errors were encountered: