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

Chatterino reverts back to default settings after system restart #3262

Closed
Shigure02 opened this issue Oct 1, 2021 · 11 comments
Closed

Chatterino reverts back to default settings after system restart #3262

Shigure02 opened this issue Oct 1, 2021 · 11 comments
Labels
bug Something isn't working as intended, or works in a confusing/unintuitive way for the user Feature: Settings Issues related to settings and window layouts OS: Windows

Comments

@Shigure02
Copy link

Shigure02 commented Oct 1, 2021

Describe your issue
It's been a long time since this issue has been going on and sometimes when I restart my computer it reverts back to its default settings

Examples:
- It reverts back to its default settings like clears the settings.
- Tabs still stay the same and format. Splits remain, Close button re-enabled, 

Possible fix
-Copying the Settings folder from the %AppData% of Chatterino AppData > Roaming > Chatterino2

OS and Chatterino Version

    Win 10 Home, V 20H2 (OS Build 19042.867)
      Chatterino 2.3.4
@Shigure02 Shigure02 added the issue-report An issue reported by a user. label Oct 1, 2021
@LosFarmosCTL
Copy link
Contributor

So only the current settings.json gets reset and everything else stays the same?

What about the commands and the .bkp backup settings files?

@Mm2PL
Copy link
Collaborator

Mm2PL commented Oct 1, 2021

I have a little suspicion that winblows kills Chatterino while saving settings, so it leaves an invalid file behind and therefore can load the settings after restarting.

I don't remember this thing happening on any other OS than Windows.

@Shigure02
Copy link
Author

So only the current settings.json gets reset and everything else stays the same?

What about the commands and the .bkp backup settings files?

I'm assuming the commands are reset as well as it wasn't saved for me and I'm not sure about the backup files as I haven't compared the differences of it yet, I apologize I'm quite new to Chatterino

@Felanbird Felanbird added bug Something isn't working as intended, or works in a confusing/unintuitive way for the user and removed issue-report An issue reported by a user. labels Nov 27, 2021
@Mm2PL Mm2PL added the Feature: Settings Issues related to settings and window layouts label Aug 12, 2022
@Felanbird
Copy link
Collaborator

It's my strong belief that this issue only happens due to the users C: drive being a HDD, and it's a very old Windows issue.
I often ran into it with World of Warcraft addons, as many of them stored all of their data in .json files.

We discussed this in the Runelite discord back in July, as a config.json file is used for Runelite, and if it corrupts due to this, the client would silently fail to start. Another dev reported their belief that this was an issue that only happened on HDD's, and I confirmed I hadn't ran into it for programs installed on an SSD (chatterino, runelite, WoW addons after getting an SSD)

afaik the changes made here: runelite/runelite@compare fixed the problem for Runelite, but they are a java app and using fsync so this info probably doesn't help.

@Nerixyz
Copy link
Contributor

Nerixyz commented Nov 3, 2023

All the saving of settings is done in https://github.com/pajlada/settings. It uses iostreams to save here. These do flush when closed. Maybe they don't flush hard enough. I wonder if it's any different with a QFile.

@pajlada
Copy link
Member

pajlada commented Nov 3, 2023

window-layout.json has the same issue, which uses QSaveFile

@Nerixyz
Copy link
Contributor

Nerixyz commented Nov 3, 2023

  • Tabs still stay the same and format. Splits remain, Close button re-enabled,

window-layout.json has the same issue, which uses QSaveFile

Tabs are saved in window-layout.json. Please clarify.

@Felanbird
Copy link
Collaborator

Felanbird commented Nov 3, 2023

Tabs are saved in window-layout.json. Please clarify.

window-layout.json is often lost in this scenario as well, but not as common

@Felanbird
Copy link
Collaborator

I will acknowledge that my most-recent issue reporter only lost their settings, window-layout and commands were not lost, but previous reports claim to also lose window-layout.
image

@wigoor
Copy link

wigoor commented Jun 29, 2024

Had this or a very similar issue happen today:
Yesterday i accidentaly pressed restart on my computer instead of shutdown, when i got back into windows i instantly shutdown windows again, the next day the settings were gone and 5/10 settings.json backup files was corrupted.
Code_wfKoTXFt2v

I have chatterino stored on an SSD though it is not my OS drive.
Shutdown might have happen during the startup of chatterino since its in my autostarts.

Chatterino Nightly 2.4.6 (commit fbc8aaca) built on 2023-11-19 with Qt 6.5.0, MSVC 193732825
Running on Windows 11 Version 22H2, kernel: 10.0.22621

pajlada pushed a commit to pajlada/settings that referenced this issue Jul 7, 2024
On Windows, this will bypass the filesystem cache. As a consequence, writes should be a bit more "atomic", while introducing a bit more work for the actual filesystem.

See also Chatterino/chatterino2#3262 and https://learn.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-movefileexw#movefile_write_through
@pajlada
Copy link
Member

pajlada commented Jul 7, 2024

This should be fixed since 2d11e79 (just merged in). If you notice it after running Chatterino after that version, please re-open or comment on this issue. pajlada/settings#87 is what actually did the work on improving this, and it looks super promising.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working as intended, or works in a confusing/unintuitive way for the user Feature: Settings Issues related to settings and window layouts OS: Windows
Projects
None yet
Development

No branches or pull requests

7 participants