-
Notifications
You must be signed in to change notification settings - Fork 41
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
Only write options after onboarding #284
Conversation
johnny9
commented
Mar 9, 2023
•
edited
Loading
edited
Needs rebase. |
45e3262
to
08be85b
Compare
ACK 08be85b |
08be85b
to
51df97d
Compare
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.
Concept ACK
src/qml/options_model.cpp
Outdated
@@ -15,8 +15,9 @@ | |||
|
|||
#include <cassert> | |||
|
|||
OptionsQmlModel::OptionsQmlModel(interfaces::Node& node) | |||
OptionsQmlModel::OptionsQmlModel(interfaces::Node& node, bool is_onboarded) |
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.
potentially, a bool indicating if we're onboarded or not could be valuable to other models. Since right now we don't have such a use case, this is fine.
tACK on WSL Ubuntu 22.04 on Works as expected, the settings file gets created after the onboarding has finished. settings.json:
Do we want the “Listen” and “natpmp” options to be true by default or was it just for testing this PR? |
tACK on Android armv7 everything worked as expected The
|
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.
ACK 51df97d
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.
Concept ACK, I'll test soon. It looks that there are some unaddressed feedback.
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.
tACK 51df97d
Tested in both master
(/ main
) and this PRs branch: changing all settings touched by this branch's code change and verify the changes were saved accordingly.
Things I noticed during testing:
In main
:
- If the user doesn't change anything
setting.json
file will look like:
{
"prune": 1907
}
- If the user disables any settings
setting.json
file will look like:
{
"prune": 0
"listen": false,
"natpmp": false,
"server": false,
"upnp": false
}
In branch johnny9:write_after_onboard
:
- If the user doesn't change anything
setting.json
file will look like:
{
"dbcache": 16000,
"listen": true,
"natpmp": true,
"prune": 1907,
"server": true,
"upnp": true
}
- If the user disables any settings
setting.json
file will look like:
{
"dbcache": 16000,
}
51df97d
to
61f8e6c
Compare
@pablomartin4btc I wasn't able to reproduce the output you were seeing during onboarding but I think I fixed the settings not applying at next startup with initializing the values in the constructor. |
tACK 61f8e6c On Ubuntu 22.04 and Android (armv7) Works as expected, settings.json shows defaults:
|
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.
tACK 61f8e6c
It behaves as expected.
dbcache
setting is not persisted anymore ("dbcache": 16000,
), is this correct?
It should only persist if you set it to a value other than nDefaultDbCache (450) |
Perfect, it works. |
61f8e6c
to
4f557b0
Compare
4f557b0
to
9e56907
Compare
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.
tACK 9e56907
lgtm, works as expected on both Ubuntu 22.04 and Android (armv7)
played around with different settings and they registered properly both in the settings.json and in the debug.log
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.
re-ACK 9e56907
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.
9e56907
writing of the settings works, but it always additionally creates a settings.json.bak
file?
@@ -8,6 +8,7 @@ | |||
#include <common/settings.h> | |||
#include <common/system.h> | |||
#include <interfaces/node.h> | |||
#include <mapport.h> | |||
#include <qt/guiconstants.h> | |||
#include <qt/guiutil.h> | |||
#include <qt/optionsmodel.h> |
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.
Do we need this?
#include <qt/optionsmodel.h> |
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.
It is needed for PruneMiBtoGB i believe
} | ||
m_onboarded = true; | ||
} |
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.
nit: accidentally removed the last line break?
} | |
} | |
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.
already has a newline character at the end of the file. don't need an additional blank line.
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.
re ACK 9e56907 on Ubuntu 22.04 works as expected