Review report

bitcoin-core/gui-qml: PR #981

2 minor findings · 1 suggestion

Findings

Link

[minor] · An empty -lang leaves the saved startup translation installed

With a saved GUI language and explicitly empty -lang, the async snapshot reports System default without removing the saved startup translation, leaving the session in the wrong language.

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

Details and suggested fix

When a saved GUI language such as es exists, -lang= or bare -lang makes startup fall back to it because GetArg returns an empty string. The snapshot instead treats the present command-line option as authoritative and resolves to "". Since m_language also starts empty, applySnapshot() emits no languageChanged. The new readiness check skips initial installation, and no readiness handler reconciles the translators. The window therefore keeps the saved translation while Settings says System default, with editing disabled by command-line precedence. Base installed the synchronously resolved language unconditionally. Install and retranslate the resolved language when the first snapshot becomes ready, and add a regression using saved es plus -lang=. No current launcher or script producing an empty -lang was found, so production frequency is unconfirmed.


Link

[minor] · Blocksonly startup temporarily exposes the Mempool settings section

With -blocksonly, the initially true availability cache exposes Mempool settings until a post-initialization status snapshot arrives; initialization failure leaves the value uncorrected for the application's remaining lifetime.

Location: qml/models/nodemodel.cpp:299 (head).

Details and suggested fix

The constructor no longer initializes m_mempool_information_available from -blocksonly, so it starts as true. Production constructs NodeModel with backend_ready=false, and refreshStatus() refuses to submit the snapshot that corrects this value until initialization succeeds. Its invocation in the failure branch therefore does nothing. The Settings button is available during initialization, and the sidebar directly binds visibility to this property. Users can consequently open a section that should be absent, then get moved to another section when the first snapshot hides it. Restore the constructor assignment for this argument-derived property and remove it from the asynchronous status snapshot, retaining the constant property contract.


Optional improvements

Link

[suggestion] · The onboarding shutdown contract has no production caller

The new beginShutdown() and shutdownFinished contract adds lifecycle branches and tests, but the production owner still destroys the onboarding model directly.

Location: qml/models/onboardingoptionsmodel.cpp:69 (head).

Details and suggested fix

PreInitOnboardingContext::close() resets the model without calling beginShutdown() or observing shutdownFinished; references outside the model are confined to tests. The new preparation-after-shutdown rejection is likewise unreachable in production: only beginShutdown() and prepareNode() set m_stopping, and repeated preparation returns first on m_preparing. Production cancellation already uses executor teardown plus the global worker drain, while preparation drains before emitting nodePrepared independently of this API. Remove the unused explicit-shutdown API, its shutdown-only branches and tests while preserving that preparation ordering, or wire the actual owner to the contract before retaining this parallel lifecycle state machine.


Coverage details