Only write options after onboarding #284

Manually merged
johnny9 merged 2 commits from write_after_onboard into main 2024-05-14 19:05:26 +00:00 AGit
johnny9 commented 2023-03-09 03:48:15 +00:00 (Migrated from github.com)

Windows
Intel macOS
Apple Silicon macOS
ARM64 Android

[![Windows](https://img.shields.io/badge/OS-Windows-green)](https://api.cirrus-ci.com/v1/artifact/github/bitcoin-core/gui-qml/win64/insecure_win_gui.zip?branch=pull/284) [![Intel macOS](https://img.shields.io/badge/OS-Intel%20macOS-green)](https://api.cirrus-ci.com/v1/artifact/github/bitcoin-core/gui-qml/macos/insecure_mac_gui.zip?branch=pull/284) [![Apple Silicon macOS](https://img.shields.io/badge/OS-Apple%20Silicon%20macOS-green)](https://api.cirrus-ci.com/v1/artifact/github/bitcoin-core/gui-qml/macos_arm64/insecure_mac_arm64_gui.zip?branch=pull/284) [![ARM64 Android](https://img.shields.io/badge/OS-Android-green)](https://api.cirrus-ci.com/v1/artifact/github/bitcoin-core/gui-qml/android/unsecure_android_apk.zip?branch=pull/284)
hebasto commented 2023-05-30 09:17:33 +00:00 (Migrated from github.com)

Needs rebase.

Needs rebase.
johnny9 commented 2023-05-31 13:39:40 +00:00 (Migrated from github.com)

update from 45e3262 to 08be85b:

  • rebased over main
update from[ 45e3262 ](https://github.com/bitcoin-core/gui-qml/commit/45e326291780c5832950518fbdf305defb53458c)to 08be85b: - rebased over main
thebagmaster commented 2023-06-04 02:01:42 +00:00 (Migrated from github.com)

ACK 08be85b
I tested these on Ubuntu 22.04.2 and it does what it says on the tin.
Understood that we may need to buffer the settings writing to file in on-boarding; especially if the storage location is not set and may change.
Maybe we should do our best to save what we can of what the user configured?
Are there situations where we buffer settings and different settings that we save immediately?

ACK [08be85b](https://github.com/bitcoin-core/gui-qml/commit/08be85b55feb5fcb6b2a04c669fd91c74fdabbf5) I tested these on Ubuntu 22.04.2 and it does what it says on the tin. Understood that we may need to buffer the settings writing to file in on-boarding; especially if the storage location is not set and may change. Maybe we should do our best to save what we can of what the user configured? Are there situations where we buffer settings and different settings that we save immediately?
hebasto commented 2023-08-31 22:41:41 +00:00 (Migrated from github.com)
Please rebase. https://discord.com/channels/903125802726596648/903126039084015638/1146922061449666602
johnny9 commented 2023-09-01 00:48:39 +00:00 (Migrated from github.com)

Update from 08be85b to 51df97d

  • rebased with main
Update from[ 08be85b ](https://github.com/bitcoin-core/gui-qml/commit/08be85b55feb5fcb6b2a04c669fd91c74fdabbf5)to 51df97d - rebased with main
jarolrod (Migrated from github.com) reviewed 2023-09-08 06:27:39 +00:00
jarolrod (Migrated from github.com) left a comment

Concept ACK

Concept ACK
jarolrod (Migrated from github.com) commented 2023-05-26 21:25:17 +00:00

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.

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.
D33r-Gee commented 2023-12-11 18:23:22 +00:00 (Migrated from github.com)

tACK on WSL Ubuntu 22.04 on signet

Works as expected, the settings file gets created after the onboarding has finished.

settings.json:

{ "listen": true, "natpmp": true, "prune": 2861 }

Do we want the “Listen” and “natpmp” options to be true by default or was it just for testing this PR?

tACK on WSL Ubuntu 22.04 on `signet` Works as expected, the settings file gets created after the onboarding has finished. settings.json: `{ "listen": true, "natpmp": true, "prune": 2861 }` Do we want the “Listen” and “natpmp” options to be true by default or was it just for testing this PR?
D33r-Gee commented 2023-12-11 20:04:49 +00:00 (Migrated from github.com)

tACK on Android armv7 everything worked as expected

The settings.json was created after the onboarding with the following values:

{ "prune": 2861 }

tACK on Android armv7 everything worked as expected The `settings.json` was created after the onboarding with the following values: `{ "prune": 2861 }`
D33r-Gee (Migrated from github.com) reviewed 2024-03-06 19:01:09 +00:00
D33r-Gee (Migrated from github.com) left a comment

ACK 51df97d142558919e9181696359debfb98e94b0c

ACK 51df97d142558919e9181696359debfb98e94b0c
pablomartin4btc (Migrated from github.com) reviewed 2024-03-06 22:27:09 +00:00
pablomartin4btc (Migrated from github.com) left a comment

Concept ACK, I'll test soon. It looks that there are some unaddressed feedback.

Concept ACK, I'll test soon. It looks that there are some unaddressed feedback.
pablomartin4btc (Migrated from github.com) reviewed 2024-03-13 01:16:24 +00:00
pablomartin4btc (Migrated from github.com) left a comment

tACK 51df97d142558919e9181696359debfb98e94b0c

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,
}
After the user makes any changes on the settings mentioned above next time the user starts `bitcoin-qt` up again it looks like the UI doesn't match the configuration file (`settings.json`), is this expected?
  • Using main:

Screenshot from 2024-03-12 15-55-36

  • Using this branch:

Screenshot from 2024-03-12 16-03-51

tACK 51df97d142558919e9181696359debfb98e94b0c 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, } ``` <details> <summary>After the user makes any changes on the settings mentioned above next time the user starts `bitcoin-qt` up again it looks like the UI doesn't match the configuration file (`settings.json`), is this expected?</summary> - Using `main`: ![Screenshot from 2024-03-12 15-55-36](https://git.fish.foo/attachments/d134ca6e-efab-477d-a644-186e2f44843d) - Using this branch: ![Screenshot from 2024-03-12 16-03-51](https://git.fish.foo/attachments/2813fe3c-2fa5-4635-a92c-e3e1f4bbacf4) </details>
johnny9 commented 2024-03-29 03:31:54 +00:00 (Migrated from github.com)

Update 51df97d to 61f8e6c

  • Rebased with master
  • Initialized all uninitialized OptionsQmlModel properties
Update 51df97d to 61f8e6c - Rebased with master - Initialized all uninitialized OptionsQmlModel properties
johnny9 commented 2024-03-29 14:44:59 +00:00 (Migrated from github.com)

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,
}

After the user makes any changes on the settings mentioned above next time the user starts bitcoin-qt up again it looks like the UI doesn't match the configuration file (settings.json), is this expected?

@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.

> 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, > } > ``` > > After the user makes any changes on the settings mentioned above next time the user starts `bitcoin-qt` up again it looks like the UI doesn't match the configuration file (`settings.json`), is this expected? @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.
D33r-Gee commented 2024-03-29 16:56:34 +00:00 (Migrated from github.com)

tACK github.com/bitcoin-core/gui-qml@61f8e6c5fc

On Ubuntu 22.04 and Android (armv7)

Works as expected, settings.json shows defaults:

{
    "listen": true,
    "prune": 1907
}
tACK https://github.com/bitcoin-core/gui-qml/commit/61f8e6c5fcb0c6c31a6283c3b7fdf6b9f82eba5e On Ubuntu 22.04 and Android (armv7) Works as expected, settings.json shows defaults: ``` { "listen": true, "prune": 1907 } ```
pablomartin4btc (Migrated from github.com) approved these changes 2024-04-05 01:51:55 +00:00
pablomartin4btc (Migrated from github.com) left a comment

tACK 61f8e6c5fcb0c6c31a6283c3b7fdf6b9f82eba5e

It behaves as expected.

dbcache setting is not persisted anymore ("dbcache": 16000,), is this correct?

tACK 61f8e6c5fcb0c6c31a6283c3b7fdf6b9f82eba5e It behaves as expected. `dbcache` setting is not persisted anymore (`"dbcache": 16000,`), is this correct?
johnny9 commented 2024-04-05 11:06:31 +00:00 (Migrated from github.com)

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)

> `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)
pablomartin4btc commented 2024-04-05 16:01:04 +00:00 (Migrated from github.com)

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.

> > `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.
johnny9 commented 2024-04-10 03:49:03 +00:00 (Migrated from github.com)

Update from 61f8e6c to 4f557b0

  • rebased with main
Update from 61f8e6c to 4f557b0 - rebased with main
johnny9 commented 2024-04-10 11:41:39 +00:00 (Migrated from github.com)

Update from 4f557b0 to 9e56907

  • fixed build issue with previous rebase conflict (forgot to remove <<<<<<<)
Update from 4f557b0 to 9e56907 - fixed build issue with previous rebase conflict (forgot to remove <<<<<<<)
D33r-Gee (Migrated from github.com) reviewed 2024-04-10 16:47:00 +00:00
D33r-Gee (Migrated from github.com) left a comment

tACK 9e569074a1

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

tACK 9e569074a1735976ffb324dfb5531c24591f3252 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
pablomartin4btc (Migrated from github.com) approved these changes 2024-04-10 23:15:20 +00:00
pablomartin4btc (Migrated from github.com) left a comment

re-ACK 9e569074a1

re-ACK 9e569074a1735976ffb324dfb5531c24591f3252
MarnixCroes (Migrated from github.com) reviewed 2024-04-11 09:59:33 +00:00
MarnixCroes (Migrated from github.com) left a comment

9e569074a1
writing of the settings works, but it always additionally creates a settings.json.bak file?

9e569074a1735976ffb324dfb5531c24591f3252 writing of the settings works, but it always additionally creates a `settings.json.bak` file?
pablomartin4btc (Migrated from github.com) reviewed 2024-04-11 19:06:06 +00:00
pablomartin4btc (Migrated from github.com) commented 2024-04-11 19:05:52 +00:00

Do we need this?

Do we need this? ```suggestion ```
johnny9 (Migrated from github.com) reviewed 2024-05-03 19:10:34 +00:00
johnny9 (Migrated from github.com) commented 2024-05-03 19:10:34 +00:00

It is needed for PruneMiBtoGB i believe

It is needed for PruneMiBtoGB i believe
pablomartin4btc (Migrated from github.com) reviewed 2024-05-06 22:14:02 +00:00
pablomartin4btc (Migrated from github.com) commented 2024-05-06 22:14:02 +00:00

nit: accidentally removed the last line break?

}

nit: accidentally removed the last line break? ```suggestion } ```
johnny9 (Migrated from github.com) reviewed 2024-05-08 16:16:33 +00:00
johnny9 (Migrated from github.com) commented 2024-05-08 16:16:33 +00:00

already has a newline character at the end of the file. don't need an additional blank line.

already has a newline character at the end of the file. don't need an additional blank line.
D33r-Gee (Migrated from github.com) reviewed 2024-05-14 18:17:34 +00:00
D33r-Gee (Migrated from github.com) left a comment

re ACK 9e569074a1 on Ubuntu 22.04 works as expected

re ACK 9e569074a1735976ffb324dfb5531c24591f3252 on Ubuntu 22.04 works as expected
Sign in to join this conversation.
No description provided.