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

[Fix] multiple settings writes #1464

Merged
merged 4 commits into from
Jun 15, 2022
Merged

[Fix] multiple settings writes #1464

merged 4 commits into from
Jun 15, 2022

Conversation

arielj
Copy link
Collaborator

@arielj arielj commented Jun 13, 2022

This PR fixes #1463 by only writting settings when they change, and only after they are completely loaded. This applies for both Heroic's settings and games' settings.

This should improve the consistency of settings, we were storing things so many times while things where loading (I've seen up to 16 writes during the initial render!!) that it probably created some issues with race conditions having that many writes to the same files all at once.

How to test/QA

I added a call to logInfo that prints information on the logs every time call to writeConfig is done. You can play around with the settings while checking at the logs to see this is working as expected.

Note that the diff in the Files changed tab of the PR is a mess, it doesn't really reflect the changes properly, github gets really confused because I moved things around.


Use the following Checklist if you have changed something on the Backend or Frontend:

  • Tested the feature and it's working on a current and clean install.
  • Tested the main App features and they are still working on a current and clean install. (Login, Install, Play, Uninstall, Move games, etc.)
  • Created / Updated Tests (If necessary)
  • Created / Updated documentation (If necessary)

@arielj arielj added the pr:ready-for-review Feature-complete, ready for the grind! :P label Jun 13, 2022
electron/launcher.ts Outdated Show resolved Hide resolved
@flavioislima flavioislima changed the title Fix multiple settings writes [Fix] multiple settings writes Jun 13, 2022
Copy link
Member

@flavioislima flavioislima left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good in general.
In the future, I believe that could be fixed by using a React Hook that could work to write and read the settings.
But for now that is doing a good job :)

@arielj arielj merged commit c919402 into beta Jun 15, 2022
@arielj arielj deleted the fixes/settings-writes branch June 15, 2022 01:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr:ready-for-review Feature-complete, ready for the grind! :P
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants