Review report

bitcoin-core/gui-qml: PR #883

5 minor findings · 1 suggestion

Earlier concerns neither republished nor resolved: 1 suggestion. See the Run archive for their assessments.

Findings

Link

[minor] · Preparing settings directories skips first-use wallets/ initialization

With default settings, completing onboarding for a fresh default-mainnet or test-chain directory skips wallets/ initialization, so subsequent wallets use the legacy network-root layout.

Location: qml/onboarding_settings.cpp:924 (head).

Details and suggested fix

prepare_node calls PrepareSettingsDirectory before InitConfig. With the default -settings, mkpath() creates the network data directory itself. Core creates wallets/ only when that directory is absent, and the later QML EnsureSettingsDirectory has the same creation-dependent guard. Consequently, a fresh default-mainnet directory or fresh test-chain directory remains without wallets/; wallet discovery falls back to the network root, and restarting does not repair the layout. A newly selected custom mainnet directory is an exception because EnsureDataDir initializes its base-level wallets/. Before creating the settings parent, initialize absent base and network directories together with their wallets/ subdirectories, preserving existing profiles unchanged. Also make PrepareAndFinalizeModelApply follow the production sequence: it currently calls InitConfig without PrepareSettingsDirectory, so it misses this regression.


Link

[minor] · Unreadable settings suppress data-directory chooser requests

A malformed settings.json in an otherwise usable saved or default profile overrides a chooser request, leaving Reset or Abort instead of the previously available option to select another directory.

Location: qml/onboarding_settings.cpp:1013 (head).

Details and suggested fix

ResolveOnboardingStartupStatus captures -choosedatadir, bootstrap fReset, and legacy reset requests in force_data_dir_chooser, but uses that value only after reading settings successfully. Without an effective -resetguisettings, malformed settings in a usable directory cause an earlier return with settings_file_unreadable=true. ShouldShowPreInitOnboarding then skips onboarding, and startup presents Reset/Abort for the same profile. The base checked chooser requests before reading settings, allowing the user to select another directory despite the current profile's preview error. Honor force_data_dir_chooser in the unreadable-settings branch by returning an onboarding status rather than the recovery-dialog flag. This requires a non-explicit data-directory selection; no report of this malformed-settings/request combination was found, so production impact remains unconfirmed.


Link

[minor] · Write-protected config-selected profiles bypass the chooser

A readable but unwritable onboarded directory selected by bitcoin.conf can skip the chooser and fail the mandatory settings.json write, whereas the base offered directory selection.

Location: qml/onboarding_settings.cpp:1035 (head).

Details and suggested fix

With no explicit -datadir or independent chooser/reset request, a non-default config-selected directory can pass ReadResolvedProfile when it is readable and searchable and contains qml_onboarded=true. The successful-read path checks only that the resolved directory exists as a directory; it validates writability only after a failed read. For default mainnet settings stored in that protected directory, InitConfig then fails to write and rename settings.json.tmp, reports FAILED_WRITE, and startup exits. Repeated launches fail until permissions change or the user supplies -choosedatadir. Restore ValidateCustomDataDir for resolved non-explicit, non-default directories on the successful-read path, as the base chooser did, and cover a readable but write-protected onboarded profile. No report of this permission-state combination was found, so production impact remains unconfirmed.


Link

[minor] · Settings recovery ignores application Quit events

While the unreadable-settings Reset/Abort dialog is open, the application consumes Quit events without closing the dialog, so startup still waits for a manual choice.

Location: qml/bitcoin.cpp:384 (head).

Details and suggested fix

An unreadable settings.json without an effective -resetguisettings routes startup through synchronous node preparation into ErrorSettingsRead. Its QMessageBox::exec() does not observe QmlQuitHandler, whose application event filter consumes QEvent::Quit and emits quitRequested. Unlike the existing startup-dialog loop, this dialog has no connection to that signal and no pending-quit check. Repeated application Quit events therefore leave the modal loop running; choosing Reset afterward can still perform settings recovery before startup handles the pending quit. Pass the quit handler into ErrorSettingsRead, return Abort if quitting is already requested, and finish the box with the Abort result on quitRequested. Extend the application-Quit startup tests to cover this recovery dialog and verify that quitting leaves settings unchanged.


Link

[minor] · Relative -conf paths cause false profile-drift failures for new folders

For a newly selected folder, preview ignores an explicit relative -conf that Core later reads, so the new profile-drift check can reject confirmed onboarding even though the configuration did not change.

Location: qml/onboarding_settings.cpp:286 (head).

Details and suggested fix

ReadConfigForNewDataDir returns success without reading a relative primary -conf. After confirmation, PrepareApplyToArgs creates the selected folder and applies -datadir; pinned Core then resolves a path such as -conf=../shared.conf against that folder and reads it. If the file selects another chain, enables reset, or changes the settings path, ValidatePendingApply rejects the mismatch as profile drift after InitConfig has already created directories and written settings. A missing explicit file instead fails after confirmation. The preview omission existed at base, but the drift-based rejection is new. Resolve and read explicitly supplied relative configuration paths against the proposed folder without creating it, while retaining the no-config behavior when -conf is absent. No current user passing a relative -conf together with a newly selected folder was identified, so production impact remains unconfirmed.


Optional improvements

Link

[suggestion] · Settings-file recovery also discards unrelated GUI preferences

Choosing Reset for corrupt settings.json also clears GUI preferences and legacy settings, unlike bitcoin-qt's identical prompt, although guisettings.ini.bak preserves the active GUI values.

Location: qml/onboarding_settings.cpp:1214 (head).

Details and suggested fix

The recovery dialog uses bitcoin-qt's Reset/Abort wording, but its captured backup makes FinalizeStartupSettings perform a full GUI reset. On the synchronous recovery path, pending is null: the reset preserves only strDataDir in active QSettings, sets fReset=true, marks a distinct bootstrap store likewise, and cleans the legacy Bitcoin-Qt settings stores. Startup then continues without onboarding in this launch. Pinned bitcoin-qt's callback only accepts rewriting the unreadable settings.json; corruption there does not require clearing language, theme, display-unit, or window preferences. Keep recovery scoped to settings.json while retaining its byte-exact backup. If a full GUI reset is the intended product behavior, explicitly disclose that wider scope in the prompt and PR, and consider running reset onboarding before starting the node.


Coverage details

Earlier concerns

Earlier reports raised these, with the titles and severities shown there. This review neither republished nor resolved them.