Wiring for Custom Datadir #408

Closed
D33r-Gee wants to merge 9 commits from qml-datadir-custom-wiring into main AGit
D33r-Gee commented 2024-06-15 00:01:50 +00:00 (Migrated from github.com)

This pull request builds upon previous issues (#390, #392, and #397) by re-introducing the functionality for users to specify a custom data directory (datadir) during the onboarding process.

The majority of changes in qml/bitcoin.cpp are mainly splitting the onboarding and node creation so that the user can set their preferred datatdir it's inspired by the qt/bitcoin.cpp however it uses the anonymous namespace instead of using a class. The intention came from feedback on https://github.com/bitcoin-core/gui-qml/pull/390

In the QML pages, the node_model context property is no longer been initialized during onboarding. We're now using options_model instead. This means the code has been updated to use the options_model for settings that were previously set with the node_model context property.

Support for the Android version is being added to this PR.

This pull request builds upon previous issues (#390, #392, and #397) by re-introducing the functionality for users to specify a custom data directory (`datadir`) during the onboarding process. The majority of changes in `qml/bitcoin.cpp` are mainly splitting the onboarding and node creation so that the user can set their preferred `datatdir` it's inspired by the `qt/bitcoin.cpp` however it uses the anonymous namespace instead of using a class. The intention came from feedback on https://github.com/bitcoin-core/gui-qml/pull/390 In the QML pages, the `node_model` context property is no longer been initialized during onboarding. We're now using `options_model` instead. This means the code has been updated to use the `options_model` for settings that were previously set with the `node_model` context property. Support for the Android version is being added to this PR.
johnny9 (Migrated from github.com) requested changes 2024-06-15 03:43:32 +00:00
johnny9 (Migrated from github.com) left a comment

https://github.com/bitcoin-core/gui-qml/actions/runs/9523738145/job/26255610402?pr=408

qml/models/options_model.cpp:232:9: error: use of undeclared identifier 'settings'
        settings.setValue("strDataDir", path);
        ^

Android builds are failing. Will need that fixed.

My testing on desktop seemed to work well. I had one odd thing happening. After onboarding, I tried again with using -resetguisettings and the onboarding page had a strange Custom path as the initial selection. I imagine this is maybe just resetguisettings not clearing out the datadir in QSettings but haven't dug in yet.

Screenshot from 2024-06-14 23-26-36

https://github.com/bitcoin-core/gui-qml/actions/runs/9523738145/job/26255610402?pr=408 ``` qml/models/options_model.cpp:232:9: error: use of undeclared identifier 'settings' settings.setValue("strDataDir", path); ^ ``` Android builds are failing. Will need that fixed. My testing on desktop seemed to work well. I had one odd thing happening. After onboarding, I tried again with using -resetguisettings and the onboarding page had a strange Custom path as the initial selection. I imagine this is maybe just resetguisettings not clearing out the datadir in QSettings but haven't dug in yet. ![Screenshot from 2024-06-14 23-26-36](https://git.fish.foo/attachments/708210a6-eca8-4ea0-949d-e6dad6a89a6e)
D33r-Gee commented 2024-06-17 23:48:01 +00:00 (Migrated from github.com)

Thanks @johnny9 for testing

Android builds are failing. Will need that fixed.

addressed it for now with the latest push 679818a

My testing on desktop seemed to work well. I had one odd thing happening. After onboarding, I tried again with using -> > resetguisettings and the onboarding page had a strange Custom path as the initial selection. I imagine this is maybe just resetguisettings not clearing out the datadir in QSettings but haven't dug in yet.

Addressed the above for now... although there are a few issues when using the -resetguisettings flag, so a question I have is is it crucial to address them here or can they be addressed in later PRs that specifically tackle them?

Thanks @johnny9 for testing > Android builds are failing. Will need that fixed. addressed it for now with the latest push [679818a](https://github.com/bitcoin-core/gui-qml/commit/679818a1d289f7d76f463b6deb13dd1c828eb486) > My testing on desktop seemed to work well. I had one odd thing happening. After onboarding, I tried again with using -> > resetguisettings and the onboarding page had a strange Custom path as the initial selection. I imagine this is maybe just resetguisettings not clearing out the datadir in QSettings but haven't dug in yet. Addressed the above for now... although there are a few issues when using the -resetguisettings flag, so a question I have is is it crucial to address them here or can they be addressed in later PRs that specifically tackle them?
MarnixCroes (Migrated from github.com) reviewed 2024-06-18 08:24:06 +00:00
MarnixCroes (Migrated from github.com) left a comment

679818a1d289f7d76f463b6deb13dd1c828eb486

  • during onboarding, when clicking Custom datadir it gives this output in terminal
Model size of -106 is less than 0
Model size of -6 is less than 0
  • startNode and startOnboarding have a lot of duplicate code. maybe consider extracting common functionality to avoid duplication?
679818a1d289f7d76f463b6deb13dd1c828eb486 - during onboarding, when clicking `Custom datadir` it gives this output in terminal ``` Model size of -106 is less than 0 Model size of -6 is less than 0 ``` - startNode and startOnboarding have a lot of duplicate code. maybe consider extracting common functionality to avoid duplication?
MarnixCroes (Migrated from github.com) commented 2024-06-18 08:21:28 +00:00

some are defined but not used
and give compile warning

qml/bitcoin.cpp:195:10: warning: ‘{anonymous}::m_introThread’ defined but not used [-Wunused-variable]
  195 | QThread* m_introThread;
      |          ^~~~~~~~~~~~~
qml/bitcoin.cpp:191:5: warning: ‘{anonymous}::m_prune_size_gb’ defined but not used [-Wunused-variable]
  191 | int m_prune_size_gb;
      |     ^~~~~~~~~~~~~~~
qml/bitcoin.cpp:190:6: warning: ‘{anonymous}::m_prune’ defined but not used [-Wunused-variable]
  190 | bool m_prune;
      |      ^~~~~~~
qml/bitcoin.cpp:178:15: warning: ‘{anonymous}::m_window’ defined but not used [-Wunused-variable]
  178 | QQuickWindow* m_window;
      |               ^~~~~~~~
some are defined but not used and give compile warning ``` qml/bitcoin.cpp:195:10: warning: ‘{anonymous}::m_introThread’ defined but not used [-Wunused-variable] 195 | QThread* m_introThread; | ^~~~~~~~~~~~~ qml/bitcoin.cpp:191:5: warning: ‘{anonymous}::m_prune_size_gb’ defined but not used [-Wunused-variable] 191 | int m_prune_size_gb; | ^~~~~~~~~~~~~~~ qml/bitcoin.cpp:190:6: warning: ‘{anonymous}::m_prune’ defined but not used [-Wunused-variable] 190 | bool m_prune; | ^~~~~~~ qml/bitcoin.cpp:178:15: warning: ‘{anonymous}::m_window’ defined but not used [-Wunused-variable] 178 | QQuickWindow* m_window; | ^~~~~~~~ ```
MarnixCroes (Migrated from github.com) commented 2024-06-18 08:00:23 +00:00

qrc:/qml/components/StorageLocations.qml:19:5: QML OptionButton: Binding loop detected for property "customDir"

select custom datadir -> select default -> select custom datadir -> default keeps being selected in GUI

`qrc:/qml/components/StorageLocations.qml:19:5: QML OptionButton: Binding loop detected for property "customDir"` select custom datadir -> select default -> select custom datadir -> default keeps being selected in GUI
D33r-Gee commented 2024-06-18 20:36:27 +00:00 (Migrated from github.com)

679818a

Thanks testing and reviewing @MarnixCroes

  • during onboarding, when clicking Custom datadir it gives this output in terminal
Model size of -106 is less than 0
Model size of -6 is less than 0

Hmmm... not sure what that is... will look into it

  • startNode and startOnboarding have a lot of duplicate code. maybe consider extracting common functionality to avoid duplication?

Yes some refinement can be done there... will look into how best approach it

> [679818a](https://github.com/bitcoin-core/gui-qml/commit/679818a1d289f7d76f463b6deb13dd1c828eb486) Thanks testing and reviewing @MarnixCroes > > * during onboarding, when clicking `Custom datadir` it gives this output in terminal > > ``` > Model size of -106 is less than 0 > Model size of -6 is less than 0 > ``` Hmmm... not sure what that is... will look into it > > * startNode and startOnboarding have a lot of duplicate code. maybe consider extracting common functionality to avoid duplication? Yes some refinement can be done there... will look into how best approach it
D33r-Gee commented 2024-06-18 20:41:26 +00:00 (Migrated from github.com)

Currently tackling a strange beahvior involving the custom datadir and reading the settings files:

when going through first setup it up it works great and the settings.json file is created in the the proper place...

However on restart it seems like it doesn't read the settings.json file from the new datadir and only looks in the default directory.

Right now trying to see how that can be addressed... will update soon with what I find

Currently tackling a strange beahvior involving the custom `datadir` and reading the settings files: when going through first setup it up it works great and the `settings.json` file is created in the the proper place... However on restart it seems like it doesn't read the `settings.json` file from the new `datadir` and only looks in the default directory. Right now trying to see how that can be addressed... will update soon with what I find
D33r-Gee commented 2024-06-19 16:23:16 +00:00 (Migrated from github.com)

with aebfc89 addressed the settings.json file not being read on restart by moving the gArgs.ReadSettingsFile right before node creation in qml/bitcoin.cpp

Now will tackle the -resetguisettings not updating the datadir location right away

with [aebfc89](https://github.com/bitcoin-core/gui-qml/commit/aebfc89b7e983748e95708dbd7e088fba171b9ec) addressed the `settings.json` file not being read on restart by moving the `gArgs.ReadSettingsFile` right before node creation in `qml/bitcoin.cpp` Now will tackle the `-resetguisettings` not updating the `datadir` location right away
D33r-Gee commented 2024-06-20 20:08:27 +00:00 (Migrated from github.com)

with the latest update 5ef5d19 addressed the -resetguisettings discrepencies.

It now resets to defaults and allows for changing the datadir

Next will tackle code optimization...

with the latest update [5ef5d19](https://github.com/bitcoin-core/gui-qml/commit/5ef5d1917ca73982cd1d51d99f872449b6d985d8) addressed the `-resetguisettings` discrepencies. It now resets to defaults and allows for changing the `datadir` Next will tackle code optimization...
D33r-Gee commented 2024-06-24 21:37:30 +00:00 (Migrated from github.com)

This update 6d4c111 is the first pass at optimizing the qml/bitcoin.cpp code.

There are no major functionality updates, mainly code consolidation.

This update [6d4c111](https://github.com/bitcoin-core/gui-qml/commit/6d4c111c4028525a4071cf03f6d73c8b2e579b8f) is the first pass at optimizing the qml/bitcoin.cpp code. There are no major functionality updates, mainly code consolidation.
D33r-Gee (Migrated from github.com) reviewed 2024-06-27 16:50:36 +00:00
D33r-Gee (Migrated from github.com) commented 2024-06-27 16:50:36 +00:00

done! Used new function to mitigate "default reset" issues

done! Used new function to mitigate "default reset" issues
D33r-Gee (Migrated from github.com) reviewed 2024-06-27 16:51:51 +00:00
D33r-Gee (Migrated from github.com) commented 2024-06-27 16:51:51 +00:00

Thanks for catching those!

removed unused member variables...

Thanks for catching those! removed unused member variables...
D33r-Gee commented 2024-06-27 16:53:50 +00:00 (Migrated from github.com)
  • during onboarding, when clicking Custom datadir it gives this output in terminal
Model size of -106 is less than 0
Model size of -6 is less than 0

@MarnixCroes are you still seeing the above pop-up with 6d4c111?

> * during onboarding, when clicking `Custom datadir` it gives this output in terminal > > ``` > Model size of -106 is less than 0 > Model size of -6 is less than 0 > ``` @MarnixCroes are you still seeing the above pop-up with [6d4c111](https://github.com/bitcoin-core/gui-qml/commit/6d4c111c4028525a4071cf03f6d73c8b2e579b8f)?
pablomartin4btc (Migrated from github.com) reviewed 2024-06-27 17:11:26 +00:00
pablomartin4btc (Migrated from github.com) left a comment

tACK 6d4c111c4028525a4071cf03f6d73c8b2e579b8f

Normal use case, running bitcoin-qt and setting the custom data dir in one go, works as expected.

A use case that has an issue I think, which is selecting a custom datadir, going back to the default, I can't manage to set a custom datadir back, the default remains selected and this is working in main.

I got this crash (not always but quite common) when I click on the "Custom" component:

./src/qt/bitcoin-qt -signet
Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
**
Gtk:ERROR:../../../../gtk/gtkpathbar.c:1342:set_button_image_get_info_cb: assertion failed: (cancellable == data->button_data->cancellable)
Bail out! Gtk:ERROR:../../../../gtk/gtkpathbar.c:1342:set_button_image_get_info_cb: assertion failed: (cancellable == data->button_data->cancellable)
Aborted (core dumped)

To reproduce it delete any settings.json and any "BitcoinCore-App*.conf" in home/.config/BitcoinCore.

Code-wise I need more time to check the changes, especially the last commit, cannot be split? It would be useful to add a brief description of the intention, what's the intention of the changes in the protocol of bitcoin.cpp (re-structuring it for clarity? something was missing/ needed?).

On the first commit, the commit name doesn't explain much either (eg , it seems there's a refactoring within, what's the motivation behind making node a pointer instead of a reference? If you check the code in core/ qt it's always defined as &. Is there an issue you are trying to solve or just syntax or semantic?).

tACK 6d4c111c4028525a4071cf03f6d73c8b2e579b8f Normal use case, running `bitcoin-qt` and setting the custom data dir in one go, works as expected. A use case that has an issue I think, which is selecting a custom datadir, going back to the default, I can't manage to set a custom datadir back, the default remains selected and this is working in `main`. I got this crash (not always but quite common) when I click on the "Custom" component: ``` ./src/qt/bitcoin-qt -signet Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway. ** Gtk:ERROR:../../../../gtk/gtkpathbar.c:1342:set_button_image_get_info_cb: assertion failed: (cancellable == data->button_data->cancellable) Bail out! Gtk:ERROR:../../../../gtk/gtkpathbar.c:1342:set_button_image_get_info_cb: assertion failed: (cancellable == data->button_data->cancellable) Aborted (core dumped) ``` To reproduce it delete any `settings.json` and any "`BitcoinCore-App*.conf`" in `home/.config/BitcoinCore`. Code-wise I need more time to check the changes, especially the last commit, cannot be split? It would be useful to add a brief description of the intention, what's the intention of the changes in the protocol of `bitcoin.cpp` (re-structuring it for clarity? something was missing/ needed?). On the first commit, the commit name doesn't explain much either (eg , it seems there's a refactoring within, what's the motivation behind making node a pointer instead of a reference? If you check the code in core/ qt it's always defined as &. Is there an issue you are trying to solve or just syntax or semantic?).
pablomartin4btc (Migrated from github.com) reviewed 2024-06-28 08:29:50 +00:00
pablomartin4btc (Migrated from github.com) commented 2024-06-28 08:29:50 +00:00

Every commit should pass compilation and all tests so if the failure occurs on the previous commit you should include it there (we are missing the "CI / test each commit (pull_request)" that exists on the other repos and I think @hebasto has it pending with other things he wanted to merge here into this repo).

Every commit should pass compilation and all tests so if the failure occurs on the previous commit you should include it there (we are missing the "`CI / test each commit (pull_request)`" that exists on the other repos and I think @hebasto has it pending with other things he wanted to merge here into this repo).
hebasto (Migrated from github.com) reviewed 2024-06-28 08:46:31 +00:00
hebasto (Migrated from github.com) commented 2024-06-28 08:46:31 +00:00

Why not delete it?

Why not delete it?
MarnixCroes commented 2024-06-28 10:27:15 +00:00 (Migrated from github.com)
  • during onboarding, when clicking Custom datadir it gives this output in terminal
Model size of -106 is less than 0
Model size of -6 is less than 0

@MarnixCroes are you still seeing the above pop-up with 6d4c111?

I do not

> > * during onboarding, when clicking `Custom datadir` it gives this output in terminal > > > > ``` > > Model size of -106 is less than 0 > > Model size of -6 is less than 0 > > ``` > > @MarnixCroes are you still seeing the above pop-up with [6d4c111](https://github.com/bitcoin-core/gui-qml/commit/6d4c111c4028525a4071cf03f6d73c8b2e579b8f)? I do not
MarnixCroes (Migrated from github.com) reviewed 2024-06-28 10:31:36 +00:00
MarnixCroes (Migrated from github.com) commented 2024-06-28 10:31:36 +00:00

default keeps being selected in GUI

this is still an issue
(6d4c111c4028525a4071cf03f6d73c8b2e579b8f)

> default keeps being selected in GUI this is still an issue (6d4c111c4028525a4071cf03f6d73c8b2e579b8f)
D33r-Gee commented 2024-06-28 15:50:49 +00:00 (Migrated from github.com)

Thanks @pablomartin4btc for testing and for your questions.

what's the intention of the changes in the protocol of bitcoin.cpp (re-structuring it for clarity?

The majority of changes in qml/bitcoin.cpp are mainly splitting the onboarding and node creation so that the user can set their preferred datatdir it's inspired by the qt/bitcoin.cpp however it uses the anonymous namespace instead of using a class. The intention came from feedback on #390

what's the motivation behind making node a pointer instead of a reference?

I'm assuming you are referencing: github.com/bitcoin-core/gui-qml@f3b8c5a625/src/qml/models/options_model.cpp (L27)

if so the logic there came from having to initiate the options_model in qml/bitcoin.cpp with the node as a nullptr. And this was a way for it to work with the least amount of changes.

If you check the code in core/ qt it's always defined as &. Is there an issue you are trying to solve or just syntax or semantic?).

Yes in qt/bitcoin.cpp the OptionsModel is initiated through a reference because node creation doesn't happen until the splashscreen/intro have gone through and no settings are being set with the OptionsModel.

On the other hand in qml/bitcoin.cpp the options_model is needed for onboarding so initiating it with a nullptr is allowing the QML context property to be set without Node initiation.

Thanks @pablomartin4btc for testing and for your questions. > what's the intention of the changes in the protocol of `bitcoin.cpp` (re-structuring it for clarity? The majority of changes in qml/bitcoin.cpp are mainly splitting the onboarding and node creation so that the user can set their preferred `datatdir` it's inspired by the qt/bitcoin.cpp however it uses the anonymous namespace instead of using a class. The intention came from feedback on #390 > what's the motivation behind making node a pointer instead of a reference? I'm assuming you are referencing: https://github.com/bitcoin-core/gui-qml/blob/f3b8c5a625a64ab490f9ba271c5310f988c5a0ae/src/qml/models/options_model.cpp#L27 if so the logic there came from having to initiate the `options_model` in `qml/bitcoin.cpp` with the node as a `nullptr`. And this was a way for it to work with the least amount of changes. > If you check the code in core/ qt it's always defined as &. Is there an issue you are trying to solve or just syntax or semantic?). Yes in `qt/bitcoin.cpp` the OptionsModel is initiated through a reference because node creation doesn't happen until the splashscreen/intro have gone through and no settings are being set with the OptionsModel. On the other hand in `qml/bitcoin.cpp` the `options_model` is needed for onboarding so initiating it with a `nullptr` is allowing the QML context property to be set without `Node` initiation.
D33r-Gee (Migrated from github.com) reviewed 2024-07-01 15:03:14 +00:00
D33r-Gee (Migrated from github.com) commented 2024-07-01 15:03:14 +00:00

left in case there's another way... removing it on the next push

left in case there's another way... removing it on the next push
D33r-Gee (Migrated from github.com) reviewed 2024-07-01 17:38:58 +00:00
D33r-Gee (Migrated from github.com) commented 2024-07-01 17:38:58 +00:00

Thanks for checking this... The issue is now addressed in 7a34b0d

Thanks for checking this... The issue is now addressed in [7a34b0d](https://github.com/bitcoin-core/gui-qml/commit/7a34b0da39c0fe63b56981787a8177f492febd1a)
D33r-Gee (Migrated from github.com) reviewed 2024-07-01 17:40:01 +00:00
D33r-Gee (Migrated from github.com) commented 2024-07-01 17:40:01 +00:00

commented out sections are now deleted with 7a34b0d

commented out sections are now deleted with [7a34b0d](https://github.com/bitcoin-core/gui-qml/commit/7a34b0da39c0fe63b56981787a8177f492febd1a)
MarnixCroes (Migrated from github.com) reviewed 2024-07-01 21:05:53 +00:00
MarnixCroes (Migrated from github.com) left a comment

7a34b0da39c0fe63b56981787a8177f492febd1a
did some manual testing, so far works ok

some commits could be squashed imo, also as Pablo mentioned here https://github.com/bitcoin-core/gui-qml/pull/408#discussion_r1658350670

7a34b0da39c0fe63b56981787a8177f492febd1a did some manual testing, so far works ok some commits could be squashed imo, also as Pablo mentioned here https://github.com/bitcoin-core/gui-qml/pull/408#discussion_r1658350670
MarnixCroes (Migrated from github.com) commented 2024-07-01 20:54:07 +00:00

what's your idea behind commenting them out, instead of removing?
also at other places

they could be removed as you already did at few other places

what's your idea behind commenting them out, instead of removing? also at other places they could be removed as you already did at few other places
MarnixCroes (Migrated from github.com) commented 2024-07-01 20:55:24 +00:00

what's up with this?

what's up with this?
D33r-Gee commented 2024-07-01 22:19:51 +00:00 (Migrated from github.com)

Thanks @MarnixCroes for testing and @hebasto for the comments.

Will update once more with cleaner and clearer commits...

Also working on the Android version... Found a workaround for QSettings not working with Android, will post Android related commits soon...

Thanks @MarnixCroes for testing and @hebasto for the comments. Will update once more with cleaner and clearer commits... Also working on the Android version... Found a workaround for QSettings not working with Android, will post Android related commits soon...
D33r-Gee (Migrated from github.com) reviewed 2024-07-01 23:31:54 +00:00
D33r-Gee (Migrated from github.com) commented 2024-07-01 23:31:54 +00:00

removed with latest push

removed with latest push
D33r-Gee (Migrated from github.com) reviewed 2024-07-01 23:32:14 +00:00
D33r-Gee (Migrated from github.com) commented 2024-07-01 23:32:14 +00:00

removed it with latest update

removed it with latest update
D33r-Gee commented 2024-07-02 19:33:06 +00:00 (Migrated from github.com)

This update 2cf64dd introduces Android functionality by creating qml/androidcustomdatadir files. This allows the app to retrieve the custom data directory path, if previously set by the user.

This update [2cf64dd](https://github.com/bitcoin-core/gui-qml/commit/2cf64dd91420b6b18af3af14f249956b2e4167ee) introduces Android functionality by creating qml/androidcustomdatadir files. This allows the app to retrieve the custom data directory path, if previously set by the user.
johnny9 (Migrated from github.com) reviewed 2024-07-03 16:27:28 +00:00
johnny9 (Migrated from github.com) commented 2024-07-03 16:27:20 +00:00

statically defining all of these pointers is concerning. Eventhough it is redundant it feels safer to keep a lot of these withing the function scopes.

statically defining all of these pointers is concerning. Eventhough it is redundant it feels safer to keep a lot of these withing the function scopes.
D33r-Gee (Migrated from github.com) reviewed 2024-07-03 23:04:32 +00:00
D33r-Gee (Migrated from github.com) commented 2024-07-03 23:04:32 +00:00

Ok thanks for looking into it... will refactor further to use arguments instead of pointers

Ok thanks for looking into it... will refactor further to use arguments instead of pointers
D33r-Gee (Migrated from github.com) reviewed 2024-07-10 20:43:20 +00:00
D33r-Gee (Migrated from github.com) commented 2024-07-10 20:43:20 +00:00

After our online chat, let's keep things as is with the caveat that if any issues arise due to the static pointers we'll have to refactor further. Resolving for now...

After our online chat, let's keep things as is with the caveat that if any issues arise due to the static pointers we'll have to refactor further. Resolving for now...
johnny9 (Migrated from github.com) approved these changes 2024-07-12 04:34:28 +00:00
johnny9 (Migrated from github.com) left a comment

tACK 2cf64dd91420b6b18af3af14f249956b2e4167ee

Onboarded with a custom directory, started IBD, then restarted the application to make sure the application continued to use the custom directory. Worked on both Linux Desktop and Android.

tACK 2cf64dd91420b6b18af3af14f249956b2e4167ee Onboarded with a custom directory, started IBD, then restarted the application to make sure the application continued to use the custom directory. Worked on both Linux Desktop and Android.
hebasto commented 2024-07-12 09:57:07 +00:00 (Migrated from github.com)
The https://github.com/bitcoin-core/gui-qml/pull/408/files#r1658350670 still needs to be addressed.
hebasto (Migrated from github.com) reviewed 2024-07-12 09:59:59 +00:00
hebasto (Migrated from github.com) commented 2024-07-12 09:59:58 +00:00

Why this change is required? Is it safe?

Why this change is required? Is it safe?
hebasto (Migrated from github.com) reviewed 2024-07-12 10:07:58 +00:00
hebasto (Migrated from github.com) commented 2024-07-12 10:07:48 +00:00

Comments like that seem add no value. However, this sentence is more suitable for a commit message.

Comments like that seem add no value. However, this sentence is more suitable for a commit message.
hebasto (Migrated from github.com) commented 2024-07-12 10:04:49 +00:00

After our online chat...

Could the main points from that discussion be posted here?

> After our online chat... Could the main points from that discussion be posted here?
hebasto (Migrated from github.com) commented 2024-07-12 10:06:37 +00:00

Comments like that seem add no value. However, this sentence is more suitable for a commit message.

Comments like that seem add no value. However, this sentence is more suitable for a commit message.
D33r-Gee (Migrated from github.com) reviewed 2024-07-12 16:34:54 +00:00
D33r-Gee (Migrated from github.com) commented 2024-07-12 16:34:54 +00:00

To summarize our convo: We talked about the safety of static pointers in the code. We thought about adding a class like in #390, however decided to leave them for now, since there might be issues raised by @Jarold that we need to consider first. That said we both agreed that having a clear owner for pointers is usually a good idea for better code management. Is there anything I missed @johnny9 ?

To summarize our convo: We talked about the safety of static pointers in the code. We thought about adding a class like in #390, however decided to leave them for now, since there might be [issues](https://github.com/bitcoin-core/gui-qml/pull/390#discussion_r1531658261) raised by @Jarold that we need to consider first. That said we both agreed that having a clear owner for pointers is usually a good idea for better code management. Is there anything I missed @johnny9 ?
D33r-Gee (Migrated from github.com) reviewed 2024-07-12 18:11:57 +00:00
D33r-Gee (Migrated from github.com) commented 2024-07-12 18:11:57 +00:00

Looking into it...

Looking into it...
D33r-Gee commented 2024-07-15 17:13:10 +00:00 (Migrated from github.com)

With the latest push 28ab2a0 reverted the AppMode definition in qml/bitcoin.cpp to the original. Also cleaned out comments based on @hebasto feedback.

With the latest push [28ab2a0](https://github.com/bitcoin-core/gui-qml/commit/28ab2a0a06571f4ec500fa500ec0cab738dd0694) reverted the `AppMode` definition in `qml/bitcoin.cpp` to the original. Also cleaned out comments based on @hebasto feedback.
D33r-Gee (Migrated from github.com) reviewed 2024-07-15 17:14:37 +00:00
D33r-Gee (Migrated from github.com) commented 2024-07-15 17:14:37 +00:00

Thanks for catching that, no it is not safe! While refactoring ran into some compiling errors and thought (mistakenly) that turning AppMode into a pointer would be the way to go. That’s not necessary so reverting back to the original definition.

Thanks for catching that, no it is not safe! While refactoring ran into some compiling errors and thought (mistakenly) that turning `AppMode` into a pointer would be the way to go. That’s not necessary so reverting back to the original definition.
D33r-Gee (Migrated from github.com) reviewed 2024-07-15 17:18:29 +00:00
D33r-Gee (Migrated from github.com) commented 2024-07-15 17:18:29 +00:00

Removed. Thanks for pointing that out.

Removed. Thanks for pointing that out.
D33r-Gee (Migrated from github.com) reviewed 2024-07-15 17:18:58 +00:00
D33r-Gee (Migrated from github.com) commented 2024-07-15 17:18:58 +00:00

Also removed. Thanks for pointing it out.

Also removed. Thanks for pointing it out.
MarnixCroes (Migrated from github.com) reviewed 2024-07-16 10:14:18 +00:00
MarnixCroes (Migrated from github.com) left a comment

28ab2a0a06571f4ec500fa500ec0cab738dd0694

  • the used Data Directory indicated in the GUI can be different from the actual used data direcory: run with resetguisettings -> select custom data dir -> let it create some of the files (don't have to finish IBD) -> shutdown -> delete the data (not the dir) -> launch app again (without resetguisettings) -> it uses the previous data dir (as supposed to) but in the Storage Settings it indicates it is using the default data dir which is inccorect as it is not using this.
  • I've had twice this crash, which Pablo also encountered earlier
    I did not delete any files, just ran and clicked on the Custom
Gtk:ERROR:../../../../gtk/gtkpathbar.c:1342:set_button_image_get_info_cb: assertion failed: (cancellable == data->button_data->cancellable)
Bail out! Gtk:ERROR:../../../../gtk/gtkpathbar.c:1342:set_button_image_get_info_cb: assertion failed: (cancellable == data->button_data->cancellable)
Aborted (core dumped)
28ab2a0a06571f4ec500fa500ec0cab738dd0694 - the used `Data Directory` indicated in the GUI can be different from the actual used data direcory: run with resetguisettings -> select custom data dir -> let it create some of the files (don't have to finish IBD) -> shutdown -> delete the data (not the dir) -> launch app again (without resetguisettings) -> it uses the previous data dir (as supposed to) but in the Storage Settings it indicates it is using the default data dir which is inccorect as it is not using this. - I've had twice this crash, which Pablo also encountered earlier I did not delete any files, just ran and clicked on the `Custom` ``` Gtk:ERROR:../../../../gtk/gtkpathbar.c:1342:set_button_image_get_info_cb: assertion failed: (cancellable == data->button_data->cancellable) Bail out! Gtk:ERROR:../../../../gtk/gtkpathbar.c:1342:set_button_image_get_info_cb: assertion failed: (cancellable == data->button_data->cancellable) Aborted (core dumped) ```
D33r-Gee commented 2024-07-16 21:35:04 +00:00 (Migrated from github.com)

Thanks @MarnixCroes for testing and discovering:

  • the used Data Directory indicated in the GUI can be different from the actual used data direcory: run with resetguisettings -> select custom data dir -> let it create some of the files (don't have to finish IBD) -> shutdown -> delete the data (not the dir) -> launch app again (without resetguisettings) -> it uses the previous data dir (as supposed to) but in the Storage Settings it indicates it is using the default data dir which is inccorect as it is not using this.

I've addressed it for both desktop (tested on Ubuntu 22.04) and Android with the latest push 834d8ac

Now the address persist even in the case of data deletion and not not the directory.

Thanks @MarnixCroes for testing and discovering: > * the used `Data Directory` indicated in the GUI can be different from the actual used data direcory: run with resetguisettings -> select custom data dir -> let it create some of the files (don't have to finish IBD) -> shutdown -> delete the data (not the dir) -> launch app again (without resetguisettings) -> it uses the previous data dir (as supposed to) but in the Storage Settings it indicates it is using the default data dir which is inccorect as it is not using this. I've addressed it for both desktop (tested on Ubuntu 22.04) and Android with the latest push [834d8ac](https://github.com/bitcoin-core/gui-qml/commit/834d8ac2e03d8acd55f2c686fc9e1f4b5e236659) Now the address persist even in the case of data deletion and not not the directory.
D33r-Gee commented 2024-07-16 21:36:33 +00:00 (Migrated from github.com)

I've had twice this crash, which Pablo also encountered earlier
I did not delete any files, just ran and clicked on the Custom

haven't been able to repro will investigate further...

> I've had twice this crash, which Pablo also encountered earlier I did not delete any files, just ran and clicked on the Custom haven't been able to repro will investigate further...
D33r-Gee commented 2024-07-17 15:50:18 +00:00 (Migrated from github.com)

with the latest push b67ae97 got rid off the check mark happening when clicking the custom button in StorageLocations.qml

@MarnixCroes please let me know if that fixes the GTK crash issue?

with the latest push [b67ae97](https://github.com/bitcoin-core/gui-qml/commit/b67ae97f5091726db2694d591ffb342db8ebcd1a) got rid off the check mark happening when clicking the `custom` button in `StorageLocations.qml` @MarnixCroes please let me know if that fixes the `GTK` crash issue?
MarnixCroes commented 2024-07-18 08:05:13 +00:00 (Migrated from github.com)

with the latest push b67ae97 got rid off the check mark happening when clicking the custom button in StorageLocations.qml

@MarnixCroes please let me know if that fixes the GTK crash issue?

I can still repro it on b67ae97f5091726db2694d591ffb342db8ebcd1a

> with the latest push [b67ae97](https://github.com/bitcoin-core/gui-qml/commit/b67ae97f5091726db2694d591ffb342db8ebcd1a) got rid off the check mark happening when clicking the `custom` button in `StorageLocations.qml` > > @MarnixCroes please let me know if that fixes the `GTK` crash issue? I can still repro it on b67ae97f5091726db2694d591ffb342db8ebcd1a
MarnixCroes (Migrated from github.com) reviewed 2024-07-18 08:15:03 +00:00
MarnixCroes (Migrated from github.com) left a comment

b67ae97f5091726db2694d591ffb342db8ebcd1a
the Data Directory in the GUI is also incorrect (displays the default one) when user runs with -datadir start up param

b67ae97f5091726db2694d591ffb342db8ebcd1a the Data Directory in the GUI is also incorrect (displays the default one) when user runs with -datadir start up param
MarnixCroes (Migrated from github.com) commented 2024-07-18 08:13:36 +00:00

nit

// Copyright (c) 2024 The Bitcoin Core developers

or maybe even 2023-present, which seems to be used in the main repo now.

nit ```suggestion // Copyright (c) 2024 The Bitcoin Core developers ``` or maybe even `2023-present`, which seems to be used in the main repo now.
D33r-Gee commented 2024-07-18 16:17:19 +00:00 (Migrated from github.com)

b67ae97 the Data Directory in the GUI is also incorrect (displays the default one) when user runs with -datadir start up param

Ah that's a great find... hadn't tested that... ok will update

> [b67ae97](https://github.com/bitcoin-core/gui-qml/commit/b67ae97f5091726db2694d591ffb342db8ebcd1a) the Data Directory in the GUI is also incorrect (displays the default one) when user runs with -datadir start up param Ah that's a great find... hadn't tested that... ok will update
D33r-Gee (Migrated from github.com) reviewed 2024-07-18 18:14:38 +00:00
D33r-Gee (Migrated from github.com) commented 2024-07-18 18:14:38 +00:00

good catch...

good catch...
D33r-Gee commented 2024-07-18 18:19:07 +00:00 (Migrated from github.com)

updated to 94215e5 it now displays the proper datadir when using the -datadir arg

I can still repro it on b67ae97

ok that's a bummer... will keep investigating although it's difficult to know since I'm not able to repro... will ask around

updated to [94215e5](https://github.com/bitcoin-core/gui-qml/commit/94215e5427738c56a714d0c46a63b742e542f129) it now displays the proper `datadir` when using the `-datadir` arg > I can still repro it on [b67ae97](https://github.com/bitcoin-core/gui-qml/commit/b67ae97f5091726db2694d591ffb342db8ebcd1a) ok that's a bummer... will keep investigating although it's difficult to know since I'm not able to repro... will ask around
D33r-Gee commented 2024-07-19 15:43:34 +00:00 (Migrated from github.com)

@MarnixCroes RE: the GTK crash, are you using the depends (static build) or are you using dynamic to compile?

@MarnixCroes RE: the GTK crash, are you using the depends (static build) or are you using dynamic to compile?
MarnixCroes commented 2024-07-22 07:34:04 +00:00 (Migrated from github.com)

@MarnixCroes RE: the GTK crash, are you using the depends (static build) or are you using dynamic to compile?

yes using the depends
(Pablo also encountered it earlier https://github.com/bitcoin-core/gui-qml/pull/408#pullrequestreview-2146000827)

> @MarnixCroes RE: the GTK crash, are you using the depends (static build) or are you using dynamic to compile? yes using the depends (Pablo also encountered it earlier https://github.com/bitcoin-core/gui-qml/pull/408#pullrequestreview-2146000827)
D33r-Gee commented 2024-07-22 17:04:35 +00:00 (Migrated from github.com)

@MarnixCroes RE: the GTK crash, are you using the depends (static build) or are you using dynamic to compile?

yes using the depends (Pablo also encountered it earlier #408 (review))

ok when you run dpkg -l "*gtk*" | grep ii do you get this : ii qt5-gtk-platformtheme:amd64 5.15.3+dfsg-2ubuntu0.2 amd64 Qt 5 GTK+ 3 platform theme ?

> > @MarnixCroes RE: the GTK crash, are you using the depends (static build) or are you using dynamic to compile? > > yes using the depends (Pablo also encountered it earlier [#408 (review)](https://github.com/bitcoin-core/gui-qml/pull/408#pullrequestreview-2146000827)) ok when you run `dpkg -l "*gtk*" | grep ii` do you get this : `ii qt5-gtk-platformtheme:amd64 5.15.3+dfsg-2ubuntu0.2 amd64 Qt 5 GTK+ 3 platform theme` ?
MarnixCroes commented 2024-07-23 08:52:03 +00:00 (Migrated from github.com)

ok when you run dpkg -l "*gtk*" | grep ii do you get this : ii qt5-gtk-platformtheme:amd64 5.15.3+dfsg-2ubuntu0.2 amd64 Qt 5 GTK+ 3 platform theme ?

yes

> ok when you run `dpkg -l "*gtk*" | grep ii` do you get this : `ii qt5-gtk-platformtheme:amd64 5.15.3+dfsg-2ubuntu0.2 amd64 Qt 5 GTK+ 3 platform theme` ? yes
hebasto commented 2024-08-12 09:56:34 +00:00 (Migrated from github.com)

Please rebase to resolve conflicts.

Please rebase to resolve conflicts.
D33r-Gee commented 2024-08-12 17:07:29 +00:00 (Migrated from github.com)

rebased over main with 8d53c44

tested out on WSL Ubuntu 22.04 however didn't tested out on Android...

rebased over main with [8d53c44](https://github.com/bitcoin-core/gui-qml/commit/8d53c44ad99c7844762dde5caf3aba03339bb8f4) tested out on WSL Ubuntu 22.04 however didn't tested out on Android...
MarnixCroes (Migrated from github.com) reviewed 2024-08-13 18:35:01 +00:00
MarnixCroes (Migrated from github.com) commented 2024-08-13 18:35:01 +00:00

comment could be more general, without the "moved this"
same as https://github.com/bitcoin-core/gui-qml/pull/408#discussion_r1675628865

comment could be more general, without the "moved this" same as https://github.com/bitcoin-core/gui-qml/pull/408#discussion_r1675628865
MarnixCroes (Migrated from github.com) reviewed 2024-08-13 18:35:15 +00:00
MarnixCroes (Migrated from github.com) left a comment

8d53c44ad99c7844762dde5caf3aba03339bb8f4

apart from the know crash issue (which happens occasionally) the previous issues are fixed and it works as expected.

commit history could still be improved (commits like https://github.com/bitcoin-core/gui-qml/pull/408/commits/c1067d10740fd4c3fbba89445bcfd129893e3c0b) which was also previously mentioned https://github.com/bitcoin-core/gui-qml/pull/408/commits/c1067d10740fd4c3fbba89445bcfd129893e3c0b#r1658350670

8d53c44ad99c7844762dde5caf3aba03339bb8f4 apart from the know [crash issue](8d53c44ad99c7844762dde5caf3aba03339bb8f4) (which happens occasionally) the previous issues are fixed and it works as expected. commit history could still be improved (commits like https://github.com/bitcoin-core/gui-qml/pull/408/commits/c1067d10740fd4c3fbba89445bcfd129893e3c0b) which was also previously mentioned https://github.com/bitcoin-core/gui-qml/pull/408/commits/c1067d10740fd4c3fbba89445bcfd129893e3c0b#r1658350670
D33r-Gee (Migrated from github.com) reviewed 2024-09-09 15:14:51 +00:00
D33r-Gee (Migrated from github.com) commented 2024-09-09 15:14:51 +00:00

makes sense

makes sense
D33r-Gee commented 2024-09-09 16:04:21 +00:00 (Migrated from github.com)

rebased over main with 370bc64

Addressed @MarnixCroes comment.

Tested on both Ubuntu 22.04 and Android

rebased over main with [370bc64](https://github.com/bitcoin-core/gui-qml/commit/370bc643be09c49a945eed3ca13e792cfafb385e) Addressed @MarnixCroes comment. Tested on both Ubuntu 22.04 and Android
johnny9 commented 2024-09-20 03:36:56 +00:00 (Migrated from github.com)

ACK 370bc643be09c49a945eed3ca13e792cfafb385e

tested the flow on Desktop and Android and both worked as expected without any crashing.

Desktop
Screenshot from 2024-09-17 15-23-46
Screenshot from 2024-09-17 15-23-30

Android:
Screenshot from 2024-09-17 00-11-56
Screenshot from 2024-09-17 00-12-12

ACK 370bc643be09c49a945eed3ca13e792cfafb385e tested the flow on Desktop and Android and both worked as expected without any crashing. Desktop ![Screenshot from 2024-09-17 15-23-46](https://git.fish.foo/attachments/7eda8015-386b-4090-ac2c-18e44d8e4bf2) ![Screenshot from 2024-09-17 15-23-30](https://git.fish.foo/attachments/ab17b17d-6b08-4b30-a181-eef0b3bfc720) Android: ![Screenshot from 2024-09-17 00-11-56](https://git.fish.foo/attachments/cf99bbda-020a-4718-acda-23f893f0a6cc) ![Screenshot from 2024-09-17 00-12-12](https://git.fish.foo/attachments/40389e8b-17fc-4b0d-b669-5854582639ce)
pablomartin4btc (Migrated from github.com) reviewed 2024-10-02 14:51:26 +00:00
pablomartin4btc (Migrated from github.com) left a comment

tested d76761d306 on Ubuntu 22.04.

I found a few inconsistencies regarding the commits structure:

  • As I noticed earlier, currently 4rd and 5th commits should be squashed together.
  • Same for 2nd and 3rd commits, the 2nd commit fails as you removed fullClientVersion from the node model but you didn't update the reference until the next commit.
  • I'd put all the android changes together at the end and separate from non-android stuff (in fact, going forward, if possible, I'd add them as a follow-up PR to make the review and testing easier and faster), I don't see the reason of splitting them in so many, this also would avoid other mistakes: in commit *refactoring to allow..." you are including src/qml/androidcustomdatadir.cpp that is being added 2 commits later. Commit "android: permissions for custom datadir" is not for custom datadir specific but for android "external" storage in general.

I think the PR should have 4 commits in total (maybe 5 if you want to have the android storage permission one separate).

Regarding the UI and the wiring/ persistence of the datadir configuration, it works as expected. As I mentioned in the UI only PR earlier, we need to think about the different chain-nets or when user specify -datadir, perhaps this is more related with the onboarding, do we need to trigger the onboarding if it's the first time on those situations?

Somehow I got different numbers in the storage estimation:

image

image

As it can be seen as well, regarding the Gtk error, this time didn't crash but it appears after the 6th time of bitcoin-qt execution.

(bitcoin-qt:276616): Gtk-CRITICAL **: 23:44:35.670: gtk_image_set_from_gicon: assertion 'GTK_IS_IMAGE (image)' failed

This is happening when the file dialog pops up, started to happen in the UI only PR #397.

Please try to re-org the commits, let me know if you need any help on this, so I can do another code review ASAP and we can merge this as I also need to touch the options model, onboarding and bitcoin.cpp.

tested d76761d30650e49751d055575fb4fbf996a27bb1 on Ubuntu 22.04. I found a few inconsistencies regarding the commits structure: - As I [noticed](https://github.com/bitcoin-core/gui-qml/pull/408#discussion_r1658350670) earlier, currently 4rd and 5th commits should be squashed together. - Same for 2nd and 3rd commits, the 2nd commit fails as you removed `fullClientVersion` from the node model but you didn't update the reference until the next commit. - I'd put all the android changes together at the end and separate from non-android stuff (in fact, going forward, if possible, I'd add them as a follow-up PR to make the review and testing easier and faster), I don't see the reason of splitting them in so many, this also would avoid other mistakes: in commit *refactoring to allow..." you are including `src/qml/androidcustomdatadir.cpp` that is being added 2 commits later. Commit "android: permissions for custom datadir" is not for custom datadir specific but for android "external" storage in general. I think the PR should have 4 commits in total (maybe 5 if you want to have the android storage permission one separate). Regarding the UI and the wiring/ persistence of the datadir configuration, it works as expected. As I mentioned in the UI only PR earlier, we need to think about the different chain-nets or when user specify -datadir, perhaps this is more related with the onboarding, do we need to trigger the onboarding if it's the first time on those situations? Somehow I got different numbers in the storage estimation: ![image](https://git.fish.foo/attachments/1d7c08df-eb8c-401b-8217-4a2fa8729196) ![image](https://git.fish.foo/attachments/696fe5f1-6c84-4c48-8dc3-06aebc77799d) As it can be seen as well, regarding the Gtk error, this time didn't crash but it appears after the 6th time of `bitcoin-qt` execution. `(bitcoin-qt:276616): Gtk-CRITICAL **: 23:44:35.670: gtk_image_set_from_gicon: assertion 'GTK_IS_IMAGE (image)' failed ` This is happening when the file dialog pops up, started to happen in the UI only PR #397. Please try to re-org the commits, let me know if you need any help on this, so I can do another code review ASAP and we can merge this as I also need to touch the options model, onboarding and `bitcoin.cpp`.
D33r-Gee commented 2024-10-14 17:39:54 +00:00 (Migrated from github.com)

Thanks @johnny9, @MarnixCroes, @pablomartin4btc and @hebasto for testing and reviewing this PR.

@pablomartin4btc , thanks for pointing the commit inconsistencies I will keep your feedback in mind as I publish future PRs.

After speaking with @jarolrod it is now clear that the code is not up to par (to put it politely).

I am closing it, so I can focus on AssumeUTXO integration, however I opened issue #426 so whoever takes it on can learn from my mistakes.

Thanks @johnny9, @MarnixCroes, @pablomartin4btc and @hebasto for testing and reviewing this PR. @pablomartin4btc , thanks for pointing the commit inconsistencies I will keep your feedback in mind as I publish future PRs. After speaking with @jarolrod it is now clear that the code is not up to par (to put it politely). I am closing it, so I can focus on AssumeUTXO integration, however I opened issue #426 so whoever takes it on can learn from my mistakes.
Sign in to join this conversation.
No description provided.