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

Broken config and its backup #3508

Open
2 tasks done
alexb5dh opened this issue Dec 22, 2024 · 1 comment
Open
2 tasks done

Broken config and its backup #3508

alexb5dh opened this issue Dec 22, 2024 · 1 comment

Comments

@alexb5dh
Copy link

alexb5dh commented Dec 22, 2024

Rules

  • I made myself familiar with the Readme, FAQ and Troubleshooting.
  • I understand that, if insufficient information or no app logs will be provided, my issue will be closed without an answer.

What's wrong?

Sometimes config file ends in invalid state and G-Helper resets settings to default. Problem is, that whenever it happens, backup file is also broken.

Both files are filled with 0 bytes as can be seen from the logs.

I maintain a copy of config.json in the same folder, manually updating it if any setting is changed, and using it to replace original one in case of such an issue. And this works unlike current backup solution.

How to reproduce the bug?

For me this happens when PC is shutdown unexpectedly. Sometimes it hangs when hibernating and I need to force a shutdown by holding a power button.

Yet I can't guarantee that it's 100% reproducible this way.

Logs

log.txt

"Broken config: ..." is around where the problem happens.

Device and Model

ASUS ROG Strix SCAR 15 G533QS

Additional information.

No response

Armoury Crate

Installed

Asus Services

0

Version

0.199.0

OS

Windows 10

@seerge
Copy link
Owner

seerge commented Dec 22, 2024

@alexb5dh hello,

It looks more like something in windows (?) is actually damaging config (especially since it happens during hibernation, when all apps are supposed to be stopped anyway).

As currently G-Helper already has 2 layered config saving approach:

if (backupText.Contains("{") && backupText.Contains("}"))

  1. It writes a .bak config first
  2. In 0.5 seconds it reads that file, and also verifies if it has json structure (i.e. brackets)
  3. Only if .bak is fine - it copies it into main config with windows api native file copy command that does "all or nothing" copy.

And since both files are broken in your case it means corruption happens not on writing stage, but rather "after" ?

I tried to shut down laptop couple of times right now even with a power button, and config stays in tact.

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