2 minor findings · 2 suggestions
Findings
[minor] · Failed import can leave a closed wallet row stuck as “Importing…”
If a backup's inferred name matches an existing closed wallet, the failed import can leave its selector row disabled because clearing the import state does not notify existing delegates.
Location: qml/models/walletlistmodel.cpp:180 (head).
Details and suggested fix
Importing a backup whose inferred name matches an existing closed wallet reaches Core without a collision check. Core rejects the existing database without changing the directory. Import startup notifies the existing row's LoadStateRole and ImportingRole, but clearing the import name takes this branch, calls listWalletDir(), and returns. With the same names, formats and directory flags, applyUpdatedItems() emits neither a reset nor dataChanged, so existing delegates retain importing == true and remain disabled with “Importing…”. Refreshing the unchanged listing does not repair those roles; a later model reset can recover the row. After refreshing this branch, emit dataChanged for {LoadStateRole, ImportingRole} when no reset occurred. Add an unchanged-listing collision test that checks the emitted roles, rather than only reading data().
[minor] · Tray Quit leaves the import confirmation inside a hidden window
During an import, choosing Quit from the tray with the main window hidden withholds shutdown without making the confirmation accessible.
Location: qml/pages/MainWindow.qml:99 (head).
Details and suggested fix
The tray Quit action only emits quitRequested, which now calls requestQuit(). While an import runs, that function opens quitDuringImportPopup and returns without requesting shutdown. The popup belongs to the main window's Overlay.overlay, but the quit path never shows or restores that window. A user who hid the application to the tray therefore receives no visible confirmation, and Quit appears to do nothing. A minimized window has the same accessibility problem. Choosing Show from the tray recovers the pending confirmation. Restore and activate the main window before opening the popup, using showNormal(), raise() and requestActivate() as the fatal-exception handler already does. Add a routing test that requests tray quit from a hidden window and checks that the confirmation's window becomes visible.
Optional improvements
[suggestion] · A routine wallet switch discards the import failure details
Switching to another open wallet clears the shared load error, removing both the background import failure banner and the diagnostic text its Details page needs.
Location: qml/pages/MainWindow.qml:390 (head).
Details and suggested fix
After a background import fails, selecting an already-open wallet calls clearWalletLoadStatus(). Clearing the nonempty error emits walletLoadErrorChanged, and this handler hides the failure banner. The import error page also derives its title, description and help text from that shared error, so the diagnostic is lost rather than merely hidden. The existing test deliberately expects hiding on a clear, but the comment's concern about displaying a newer, unrelated error does not require discarding import details on routine selection. Retain the failure in import-specific controller state and derive the banner's Details page from it. Clear that state when a new import starts or the user explicitly dismisses the banner. Merely keeping the banner visible when the shared error becomes empty would leave Details without its content.
[suggestion] · An import test failure can strand the worker on destroyed semaphores
importWalletLeavesLoadedWalletsSelectable() releases its blocked worker only on the success path, and its synchronization state is destroyed before the controller drains.
Location: test/test_walletqmlcontroller.cpp:819 (head).
Details and suggested fix
The restore lambda blocks on allow_restore_return.acquire(), but several QVERIFY and QCOMPARE checks can return before the sole release. Because the semaphores and captured counter are declared after DrainingWalletController, they are destroyed before its destructor calls beginShutdown() and waits up to ten seconds for draining. An assertion failure can therefore become a drain timeout or undefined behavior involving destroyed synchronization state. The sibling blocking import tests add release guards, but their semaphores still die before draining while the worker may be waking. Declare the captured synchronization state before the controller so it outlives draining, and add a release guard after the controller in this test to unblock the worker on every exit. Apply the same lifetime ordering to the guarded sibling tests without changing their success-path assertions.