mirror of
https://github.com/bitcoin-core/gui-qml.git
synced 2026-12-02 08:03:39 +00:00
Settings & Onboard Rework #742
Labels
No labels
Android
Bug
Build system
Design suggestion
Doc
Needs design review
Needs rebase
Stage
UX
Up for grabs
Upstream
Wallet
duplicate
enhancement
good first issue
question
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
bitcoin-core/gui-qml!742
Loading…
Reference in a new issue
No description provided.
Delete branch "settings-pr"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This PR wires the QML settings and onboarding flows to real Core backed settings instead of placeholder UI state. It adds persistent settings models, restart-required state, proxy configuration, display unit and money font support, third-party transaction URL support, onboarding storage validation, custom datadir handling, and test coverage for the new behavior.
-resetguisettingssupport and reset behavior for GUI-owned settings.Closes #299
Closes #596
Closes #406
Closes #373
Closes #593
Closes #431
Closes #471
Closes #511
Closes #588
Closes #598
Closes #599
Closes #587
Closes #405
Closes #419
Closes #438
Closes #704
This PR also makes progress on #594, #600 but those should stay open for remaining UX or lifecycle follow up work.
All of the new cpp modules should have unit test coverage
No bitcoinqt dependancies should be present
[ 90%] Building CXX object CMakeFiles/bitcoinqml.dir/bitcoin/src/init/bitcoin-qt.cpp.o
In file included from /usr/include/x86_64-linux-gnu/qt6/QtCore/qobject.h:18,
from /usr/include/x86_64-linux-gnu/qt6/QtCore/QObject:1,
from /home/johnny/github/gui-qml/qml/appmode.h:8,
from /home/johnny/github/gui-qml/qml/bitcoin.cpp:19:
/usr/include/x86_64-linux-gnu/qt6/QtCore/qmetatype.h: In instantiation of ‘struct QtPrivate::IsPointerToTypeDerivedFromQObject<QQuickCloseEvent*>’:
/usr/include/x86_64-linux-gnu/qt6/QtCore/qmetatype.h:1102:60: required from ‘struct QMetaTypeId<QQuickCloseEvent*>’
/usr/include/x86_64-linux-gnu/qt6/QtCore/qmetatype.h:1122:38: required from ‘struct QMetaTypeId2<QQuickCloseEvent*>’
/usr/include/x86_64-linux-gnu/qt6/QtCore/qobject_impl.h:32:41: required from ‘struct QtPrivate::TypesAreDeclaredMetaType<QtPrivate::List<QQuickCloseEvent*> >’
/usr/include/x86_64-linux-gnu/qt6/QtCore/qobject.h:306:86: required from ‘static typename std::enable_if<((QtPrivate::FunctionPointer::ArgumentCount == -1) && (! is_convertible_v<Func2, const char*>)), QMetaObject::Connection>::type QObject::connect(const typename QtPrivate::FunctionPointer::Object*, Func1, const QObject*, Func2, Qt::ConnectionType) [with Func1 = void (QQuickWindow::)(QQuickCloseEvent); Func2 = {anonymous}::RunPreInitOnboarding(PreInitOnboardingContext&, const std::vector<std::__cxx11::basic_string >&, bool)::<lambda()>; typename std::enable_if<((QtPrivate::FunctionPointer::ArgumentCount == -1) && (! is_convertible_v<Func2, const char*>)), QMetaObject::Connection>::type = QMetaObject::Connection; typename QtPrivate::FunctionPointer::Object = QQuickWindow]’
/home/johnny/github/gui-qml/qml/bitcoin.cpp:389:21: required from here
/usr/include/x86_64-linux-gnu/qt6/QtCore/qmetatype.h:842:23: error: invalid application of ‘sizeof’ to incomplete type ‘QQuickCloseEvent’
842 | static_assert(sizeof(T), "Type argument of Q_PROPERTY or Q_DECLARE_METATYPE(T*) must be fully defined");
| ^~~~~~~~~
gmake[2]: *** [CMakeFiles/bitcoinqml.dir/build.make:319: CMakeFiles/bitcoinqml.dir/qml/bitcoin.cpp.o] Error 1
gmake[2]: *** Waiting for unfinished jobs....
build failure on ubuntu 24 LTS
Left comments
This typed
QQuickWindow::closingconnection does not build on Qt 6.4 because the signal argument type,QQuickCloseEvent, is only forward-declared by the publicQQuickWindowheader there. Since this handler only quits the local event loop and does not inspect the close event, please use the string-based signal/slot form:QObject::connect(context.window, SIGNAL(closing(QQuickCloseEvent*)), &loop, SLOT(quit()));
That keeps this compatible with the repo’s Qt 6.2+ range.
This only checks whether the saved custom datadir still exists and is a directory. If the directory still exists but becomes unwritable, startup skips the chooser and still applies it as
-datadir;ApplyGuiDataDirSetting()also ignoresEnsureDataDir()failure below.Please revalidate the saved custom datadir before deciding to skip the chooser, and stop applying it if it can no longer be ensured:
This live-applies NAT-PMP even though the settings UI/test framing treats connection changes as restart-required. It also means toggling NAT-PMP does not participate in
connectionSettingsDirty(), so the restart notice can disappear even though the saved startup setting changed.If NAT-PMP is meant to match the other connection startup settings here, please make it dirty/restart-required and remove the live map-port call:
If live NAT-PMP is intentional, then the issue/test naming should be adjusted to say NAT-PMP is deliberately live-applied rather than restart-required.
The UI says
%sis the placeholder for the transaction hash, but entries without%sstill produce a link. Those links can never point at the selected transaction. Please skip malformed entries here so only URLs that actually include the txid are exposed.This new post-onboarding wallet route opens the existing add-wallet intro in
CreateWalletWizard.Context.Onboarding, but that page still shows the Back button. In this context Back sends the user back out of the create-wallet flow after pre-init onboarding has already committed startup settings and handed off to the main app.This change isn't compatible with Ubuntu 24.04 provided Qt 6.4.2. Lets move this change into a new PR that we merge in later once Ubuntu 26.04.1 LTS is released in August.
Selecting the custom storage option logs a QML deprecation warning because this handler relies on implicit signal-parameter injection:
Please use a JavaScript function with formal parameters instead.
This overview balance still uses the default font, so the new money font setting is only applied in some wallet surfaces. Please apply
optionsModel.moneyFonthere as well.This assertion is good coverage, but under Qt 6.4 the current test bridge click fallback can make the switch look checked without exercising the same QML handler path as a real user click. I hit this locally as
proxyEnableSwitch.checked == truewhilesettingsProxy.proxySettingsDirtystayed false.The bridge helper itself is not in this diff hunk, so anchoring this here. I think the fix is to prefer a real mouse press/release before falling back to raw
toggle()/clicked()invocation:Partial review till 0ec1b80f8156b1c029402241d269aad10384e3d6
qml: persist custom data directory selectionShould this be inside the
try?If the saved path is unwritable, invalid, or no longer usable, startup proceeds with a bad
-datadir016c79e75aa52e77f055945af4bfa4629e4de8c9
Can we repurpose
IPAddressValueInput.qml?Should this use
FolderDialoginstead?35795a12129fe71427c2a9b565846b94abe60192
We should probably use
InfoBannerhere and not create one-off views for this.There's no
struct DirtySnapshotin 32afebfcd04a45a2968b7913c0e948dc11e07365. This commit won't compile I guess.You might want to pull that from e92097a6ef0df5c8fa2e85b0344bc23c74657435?
32afebfcd04a45a2968b7913c0e948dc11e07365
Should we check this before we update the
m_proxy_address0ec1b80f8156b1c029402241d269aad10384e3d6
We deliberately persist the location even thought the user might not have completed the onboarding, yeah?
Would this be better?
void emitDirtySignals(const DirtySnapshot& before)Concept ACK. I wasn't able to build or test as the branch does not compile on Qt 6.4.2. Will re-review once it is buildable.
Two things stand out for the 6.4 baseline: the import QtCore swap is repo-wide, not just NetworkTraffic.qml (reply on that thread), and a new Repeater-in-ColumnLayout in ActivityDetails repeats the Quick Layouts crash class. The rest is one i18n suggestion, a nit, and replies extending existing threads. I traced the onboarding startup path: the InitConfig / parameter-interaction double-pass is idempotent by construction, so that is not a concern.
Suggestion:
qsTr("Uses about %1GB. For simple wallet use.").arg(...) + root.storageSuffix()concatenates two separately-translated strings (storageSuffix()isqsTr(" %1GB available.")). Word order varies between languages, so the glued sentence mistranslates. Merge them into oneqsTrwith a second placeholder for the available-GB value. Same at line 77.Nit:
m_storage_capacity_bytesis assigned inapplyStorageCheckResult(onboardingoptionsmodel.cpp:256) but never read. Either it is dead and the member plus assignment can go, or it is meant to drive UI and is unwired.Blocker: A
Repeateras a direct child of aColumnLayoutwhose model populates after construction (root.txidarrives via the StackView push) hits the Qt 6.4 Quick Layouts use-after-free:QQuickLayout::effectiveSizePolicy_helperruns on a freed delegate. It SIGSEGVs only under a real windowing backend, so the offscreen suite stays green. PR #746 fixes the same crash class (originally #750) inAlertPopup.qml: the action buttons live in aRowpositioner inside the layout, with the delegate usingwidthinstead ofLayout.fillWidth. The same wrap applies here.Blocker: This test and
qml_test_resetguisettings.pyare absent from.github/workflows/gui-functional-tests.yml, so the pre-init onboarding and reset-GUI-settings flows run in no CI job. Add both to the functional-test step. They refuse an external--socket-pathand self-launch, so they go in without the shared-socket args.The same
Qt.labs.settings 1.0toimport QtCoreswap is in 11 other files, so this is repo-wide:controls/Theme.qml,pages/main.qml,components/BlockClock.qml,components/BlockClockDisplayMode.qml,components/ExternalPopup.qml,components/ThemeSettings.qml,pages/node/Peers.qml,pages/wallet/Activity.qml,pages/wallet/Send.qml,pages/wallet/RequestPayment.qml,pages/wallet/ActivityDetails.qml. TheQtCoreQML module is 6.5+ (absent on a 6.4.2 install), and QML resolves imports at load, so each of these (including the main window) fails to load on 6.4.BlockClockDisplayMode.qmlandExternalPopup.qmlno longer useSettingsat all, so there the import can be dropped rather than reverted.On which modules specifically:
onboarding_storage.cpp(Evaluate/ShouldRecommendPrune) has no direct C++ test, and the QML test only exercises the mock's reimplementation of that math, so a bug in the realEvaluate()would slip through.legacy_settings_migration.cppis the branchiest new file (per-chainAppNameForChain, the legacy proxy%2-suffix parsing), and those paths look unexercised. A table-driven test that runsMigrateCoreSettings(Persist)twice and asserts each key maps correctly, the second run is a no-op, pre-existing settings are not overwritten, defaults are dropped, and a disabled-then-re-enabled proxy round-trips would cover the highest-risk behavior.Same validation path, one more gap:
NormalizeLocalPathdoes not absolutize (it returns the input unchanged when it is not afile:URL), so a relative saved datadir would be applied as-datadirand resolved against the process CWD. ReturningQDir(local).absolutePath()fromNormalizeLocalPathcloses it (checking against the__ANDROID__content://handling first).Same handler-bypass hazard elsewhere in the bridge:
cmdInvokeintestbridge.cppresolves any method or signal by name and emits it withDirectConnection, so a test can fireclicked()directly and pass without the QML handler running. A header note thatinvokeof a signal bypasses handlers would steer tests away from it.Security note on the same loop:
thirdPartyTransactionLinksonly checkshost.isEmpty(), not the scheme, so a configuredfile://host/...URL reachesQt.openUrlExternally(through the ExternalPopup confirm). Allowlistinghttp/httpshere keeps non-web schemes out at the source. The exploitation path is weak (the URL is user-configured and the popup shows it first), so this is hardening, not a blocker; Core opens these with no scheme check or confirmation at all, so it would improve on Core. Separately, the URL is shown inExternalPopupvia aCoreTextdefaulting toText.AutoText, so a URL containing markup renders as rich text on the popup;Text.PlainTexton that display removes that.its fine for now
fine for now
The current bitcoinqml_unit_tests link list contains
bitcoinqml, wallet/core libraries, GMock, and Qt test libraries, but no
bitcoinqt. The QML options-model compatibility test no longer includes
<qt/bitcoinunits.h> and instead uses a small local legacy display-unit
enum to verify the same DisplayBitcoinUnit integer mapping. This keeps the
test coverage without introducing a dependency on the legacy Qt Widgets GUI.
should be all addressed in the current stack
addressed. The branch no longer uses QML import QtCore for
Settings. The affected QML files were moved back to
import Qt.labs.settings 1.0, which is the Qt 6.4-compatible import path
addressed. The typed connection was replaced with the string-based
signal/slot form:
QObject::connect(context.window, SIGNAL(closing(QQuickCloseEvent*)), &loop, SLOT(quit())).
The handler only needs to quit the pre-init onboarding event loop, so this
keeps the same behavior without requiring Qt 6.4 to instantiate the
incomplete QQuickCloseEvent type.
addressed. qml/test/testbridge.cpp now tries real
press/release mouse events on visible, enabled QQuickItems before falling
back to raw signal/method invocation. This keeps functional tests aligned
with the same QML handler path users exercise.
addressed. The onboarding create-wallet flow no longer exposes
the intro Back action after pre-init onboarding has committed startup
settings. Functional wallet helpers were also updated to tolerate the
resulting create-wallet entry shape.
addressed. ShouldShowDataDirChooser() now revalidates a saved
non-default GUI datadir with ValidateCustomDataDir() before skipping the
chooser. ApplyGuiDataDirSetting() now stops without soft-setting
-datadir if EnsureDataDir() fails. Unit tests cover both an unusable
saved datadir and an unwritable saved datadir.
addressed by clarifying and testing the intended behavior.
NAT-PMP remains live-applied because this matches Qt Widgets behavior:
accepting the settings change persists natpmp and calls mapPort() without
requiring restart. The code now documents that NAT-PMP is intentionally
live-applied, and the unit test verifies enable and disable both update the
setting, call mapPort(), and do not mark connection settings dirty or
restart-required.
addressed. thirdPartyTransactionLinks() now skips configured
URLs that do not contain %s before exposing generated links. The unit test
includes a valid URL missing %s and verifies only the placeholder URL is
returned.
Will evaluate the security comment.
addressed. WalletBadge now applies
optionsModel.moneyFont.family and optionsModel.moneyFont.weight to the
balance text, and tst_desktopwallets.qml verifies the binding.
addressed. The onStorageSelectionChanged handler now uses a
JavaScript function with formal customStorage and customStorageAmount
parameters.
addressed. SettingsRestartNotice.qml is now a small semantic
wrapper around the shared InfoBanner component instead of custom
Rectangle/Icon/CoreText banner markup.
addressed by reflowing the stack. DirtySnapshot,
dirtySnapshot(), and emitDirtySignals(const DirtySnapshot& before) are
introduced in the same commit that first uses them, so the intermediate
commit now compiles.
addressed. Proxy location changes now flow through
QmlCoreSettings::Session::changeProxyLocation(), which trims and validates
the location before mutating m_values.proxy_address. Invalid values return
an unaccepted change and leave the previous address intact.
addressed. The final options model uses
emitDirtySignals(const DirtySnapshot& before) and keeps the dirty-state
comparison grouped in DirtySnapshot.
addressed. The branch no longer carries both components. The
existing input was refactored/renamed into
qml/controls/ProxyLocationInput.qml, and the old
IPAddressValueInput.qml file and QRC entry are gone. The new name matches
Core proxy semantics better because valid proxy locations can include
hostnames, host-with-port values, IPv6 forms, and supported unix: paths,
not only IP addresses.
addressed by the model split. Runtime OptionsQmlModel persists
runtime datadir settings immediately, which is expected for the settings
page. Pre-init onboarding uses OnboardingOptionsModel; its
selectCustomDataDir() only updates onboarding model state and preview
state. The path is ensured/applied during onboarding completion through
QmlOnboardingSettings::ApplyToArgs().
addressed. StorageLocations.qml now uses FolderDialog with a
stable customDataDirFolderDialog object name. QML tests verify the folder
dialog is present and exposes selectedFolder.
addressed together with the datadir helper review. Startup now
asks ShouldShowDataDirChooser() before applying saved GUI datadir state,
and ApplyGuiDataDirSetting() refuses to apply a saved non-default path if
EnsureDataDir() fails. That prevents an unwritable, invalid, or otherwise
unusable saved path from being silently soft-set as -datadir.
Re-review at 682d2042. The previous compile blocker is fixed: the branch now builds clean on Qt 6.4.2 and the full offscreen suite is green (unit, QML, 29 functional pass / 2 skip / 0 fail). One new blocker, plus two findings from my earlier review that are still open (followed up on their threads). Couldn't manually test it because of the new blocker.
New blocker: on Qt 6.4, a first-run user launching headed SIGSEGVs at startup before any interactive page. It is fixed in 746, if that gets merged in first can rebase onto it.
Still open from my earlier review (details on each thread): the two new functional tests are not in the CI workflow and the ActivityDetails Repeater-in-Layout is the same now-confirmed crash class.
Blocker: On Qt 6.4 (the minimum supported version), a first-run user launching headed SIGSEGVs at startup before reaching any interactive page. This PR moves onboarding into the pre-init window and lands the main window on desktopWallets for a no-wallet user, whose StackLayout eagerly instantiates the Send page and its AlertPopups at first layout, so the latent crash now fires at startup for every new user.
This is already fixed by #746 (commit b53ddbbf81 "qml: Fix Qt 6.4 use-after-free in AlertPopup actions", which wraps the actions in a Row positioner), but that fix has not landed on upstream/qt6 yet. So nothing needs to change in this PR right now, but it should rebase off 746 once it is merged.
Still unresolved at 682d2042, both Repeaters (153 and 200) are unchanged. Following the AlertPopup pointer in this comment: AlertPopup.qml on this branch still carries the broken RowLayout + Repeater, not the #746 Row-positioner fix, and it actually SIGSEGVs at first-run startup now (see the new top-level finding). So this is the same live use-after-free, not a theoretical one. Same fix here: wrap the delegates in a Column positioner with explicit widths.
Still unresolved at 682d2042, neither test is in the workflow. I ran both on this head and both pass, so they only need wiring in.
commits 662f07b455 through 682d204307 don't compile and require a small patch.
Patch to squash into 662f07b455 (qml: add display settings parity):
BitcoinUnit doesn't appear to be needed for qml for these changes.
Please rebase.
Reviewed till db326f2a04 (qml: show core setting source status in rows)
Should we bundle all the check as one property in the model?
In 32a9578bbc qml: expose core settings as entry models
Should this reject unknown keys before calling
ensureEntry()Concept ACK f029c3e1fa93ffe962e09a8ca08981992c84a2ff
(Code review in progress)
Manually tested with isolated datadirs and GUI settings dirs:
-disablewallet-qml_onboarded=1-resetguisettingsflow on an onboarded runtime profile-listen,-natpmp,-server,-proxyLet me know if I missed any scenario to test.
I can still repro #704.
I ran with an existing regtest datadir copy containing wallets and no
qml_onboardedmarker. On first launch, onboarding is shown, but it runs through the full fresh-profile wizard instead of the abbreviated existing-profile flow described in the issue.After completing onboarding, the existing wallets from the datadir are not surfaced in the app.
Request changes. Left 4 blocking comments for existing-profile safety and config handling.
disablewallet=1frombitcoin.confis still broken here.AppModeis resolved before config parsing, so a config-onlydisablewalletis missed. The wallet controller later sees the final setting and never initializes, while the main window keeps waiting for wallet startup forever. Please resolve wallet mode afterInitConfig()so config-sourceddisablewalletroutes to the node UI instead of a permanent loading state.This is not safe for an existing profile.
EnsureDataDir()always creates<datadir>/walletshere. Core uses that directory's existence to switch wallet discovery away from the datadir root, so a valid top-level wallet can disappear from the UI after onboarding even though the wallet files are still on disk. Please preserve the existing wallet discovery behavior instead of unconditionally creatingwallets/for an existing datadir.This recommendation path is not safe for an existing profile. It compares free space against a fresh-chain requirement and then marks
prunetouched, so an existing full node can be turned into a pruned node just by completing onboarding, even without the user explicitly choosing pruning. Existing blocks/chainstate need to count toward capacity here, and prune should not be auto-persisted for an existing node.This breaks Core's config-loading invariant. Preview soft-sets the resolved datadir before
ReadConfigFiles(), and the same ordering is repeated inApplyToArgs()below. If the defaultbitcoin.confcontainsdatadir=, the next config read comes from the new datadir instead of the original config source, so the rest of the config can be silently dropped and the wrong network can start. Please keep the original config source stable whendatadiris changed from config.I looked into this again. I don’t think this needs a code change in this PR.
CoreSettingsModel::entry()is only called from repo-owned QML with static keys. There is no user-provided or dynamic path that can pass arbitrary keys into this API.If an unsupported key were introduced by a future QML change, it would also fail inertly rather than persist anything: the entry returns empty/default values, setters do not match any mutation path, and session writes reject names outside the supported session setting set.
So I agree this could be a useful defensive guardrail for catching future developer mistakes, but I don’t think it is a correctness issue in the current branch. I’m leaving it asis for now.
we need to enhance this part and do something like that:
and we will assign the type to
m_keyTypeand use it instead ofm_keyby this helper, we could do something like that. It's cleaner:
I agree this is cleaner, but I want to have a discussion on the model itself at a later time. I have a few better options to implement on their own, we need to get this across the line now
Addressed in the current branch.
thirdPartyTransactionLinks()now skips entries that do not contain%s, rejects non-HTTP(S) schemes, and only exposes generated links with a host. The external-link confirmation popup also renders the configured URL asText.PlainText, so user-configured URL text is not interpreted as rich text.Coverage was added in
OptionsModelTests::thirdPartyTransactionLinksParseValidUrls()for valid HTTP(S) URLs, missing%s, malformed URLs, and non-web schemes.Addressed in the current branch.
Both dynamic
ActivityDetailsrepeater sections now live inside plainColumnpositioners instead of being direct layout-managed repeater delegates. Delegates are sized explicitly with the section width, matching the Qt 6.4-safe pattern used for the same crash class elsewhere.I also added QML component coverage for the third-party-link section so we verify the section lays out with non-zero content and collapses when no links are configured.
Addressed.
.github/workflows/gui-functional-tests.ymlnow runs both standalone tests:test/functional/qml_test_preinit_onboarding.pytest/functional/qml_test_resetguisettings.pyThese are invoked without shared socket arguments, matching the way the tests self-launch the app.
Addressed by bringing the Qt 6.4-safe popup action layout into this branch.
AlertPopup.qmlnow uses a plainRowpositioner for repeated action buttons instead of handing repeater delegates directly to a Quick Layout. This avoids the Qt 6.4 use-after-free class described here.leaving as is for now, but we can revisit soon
Addressed in the current branch.
Onboarding now preserves existing wallet discovery behavior. It only creates the network
wallets/subdirectory when the selected data directory or network data directory is newly created. Existing profiles that store wallets directly under the network datadir no longer get switched intowallets/discovery by onboarding.There is unit coverage for new-vs-existing datadir behavior and functional coverage for preserving an existing root wallet through pre-init onboarding.
Addressed.
The onboarding flow now tracks the source of the active datadir. Datadirs resolved from
bitcoin.confare treated as config-owned, not GUI-owned. Preview/apply only soft-set and persist-datadirwhen the path comes from GUI settings, legacy GUI settings, or an explicit user selection in onboarding.This preserves Core’s config-loading source: a
datadir=value from bitcoin.conf is not copied into QSettings and is not reapplied as a GUI-owned override.Addressed.
Existing profiles now bypass the automatic prune recommendation path. For an existing profile, onboarding reflects the effective prune state from config/settings/CLI and does not mark prune touched just because the fresh-chain storage recommendation would prefer pruning.
Storage validation for existing profiles also uses the existing-profile storage policy rather than fresh-chain download requirements.
Addressed.
The app now refreshes
AppMode.walletEnabledafter Core config/settings have been loaded, sodisablewallet=1frombitcoin.conforsettings.jsonis reflected in initial QML routing.The functional test covers:
-disablewalletdisablewallet=1from bitcoin.confdisablewallet=truefrom settings.json-disablewallet=0overriding bitcoin.conf-resetguisettingsis applied too early.Right now the app clears GUI settings before
bitcoin.confhas been read and before the active datadir/profile is known. If the defaultbitcoin.confredirects toB/ regtest, startup still resets the default/main profile first just by opening onboarding. Finishing onboarding later resetsB, but canceling leaves only the wrong profilemodified.
Please defer the reset until after the active profile has been resolved, and add regression coverage for both canceling and completing onboarding when the default config
redirects to another datadir.
App starts with clean gArgs.
There is no -conf, so Core’s default config location is used:
~/.bitcoin/bitcoin.conf
That default config contains:
datadir=/tmp/B
A first glance this doesn't seem to cause any issues but I think its worth double checking because its odd that the application doesn't come up after finishing onboarding.
Still finishing the rest of my review but I did find a blocker so posting it now.
On Linux, if the saved GUI-selected custom datadir still exists but is no longer readable, the app aborts at launch with an unhandled exception instead of re-showing the datadir chooser:
terminate called after throwing an instance of 'std::filesystem::__cxx11::filesystem_error'
what(): filesystem error: status: Permission denied [/bitcoin.conf]
Aborted (core dumped)
Repro:
Root cause: ResolveOnboardingStartupStatus correctly computes force_show_onboarding (ShouldShowDataDirChooser flags the directory as not writable), but then still reads the profile from it, because the gate is custom_datadir_exists = QFileInfo::exists(...) (qml/onboarding_settings.cpp, around line 406), and a mode-000 directory exists. It applies the datadir to the preview args and calls ReadConfigFiles, where fs::is_directory(conf_path) (src/common/config.cpp:134) stats /bitcoin.conf, gets EACCES, and throws. Nothing on the QML startup path catches std::filesystem_error, so the process terminates.
Suggested fix, two parts:
The existing unit test covers the unwritable case (guiDataDirChooserShowsForUnwritableConfiguredDir) but not the unreadable one, which is why this survives a green suite; a sibling test with a mode-000 directory would pin the fix.
ACK
ff0292f646I re-reviewed the latest updates and confirmed the previous blockers have been addressed. The existing-profile onboarding, config-owned datadir handling, reset/
settings behavior, disablewallet startup routing, Activity details display unit, Qt 6.4 layout/startup regressions, and functional-test registration all look covered now.
I opened follow-up issues for remaining startup/reset edge cases that should not block this PR:
Created #775 to track this. Lets not block on this bug right now.