mirror of
https://github.com/bitcoin-core/gui-qml.git
synced 2026-12-02 07:54:42 +00:00
Settings: a focused number field is saved during quit, after shutdown has started, with no confirmation or error #1114
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#1114
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
A Settings number field that still has keyboard focus when the app quits is saved during shutdown. The write is accepted after shutdown has started, so the page can show neither its restart notice nor an error.
To reproduce, with pruning already on at 10 GB (
"prune": "9536"insettings.json):2. Do not press Return.settings.jsonnow has"prune": "1907". The next start logsPrune configured to target 1907 MiBand Settings shows 2. No restart notice or confirmation was shown at any point.The same happens for Mempool size limit (MB) (300 to 50) and Database cache size (MiB), and for Script verification threads in an offscreen run. Clicking another Settings section before quitting does not change the result: the hidden field keeps focus and is saved at quit.
Controls:
2typed,kill -9leaves 9536 on disk. Nothing is written while the app is running.QmlShutdownCoordinator::requestShutdownemitsshutdownStartedbefore it runs its shutdown participants (shutdowncoordinator.cpp#L18-L30). The first handler disables every window's content item (bitcoin.cpp#L718-L724). Disabling removes focus, the field emitseditingFinished, and the page assigns the value (StorageSettingsPage.qml#L93-L101). The options model refuses commands only once it is stopping (options_model.cpp#L286-L288), and that flag is set by a participant that runs after the handler.Saving when a field loses focus is these fields' normal rule, and the project's tests rely on it. The gap is narrower:
Whether quitting should save or discard a focused edit is a product decision. Either way it should be decided before shutdown starts.
For the storage limit, a lower number becomes Core's prune target at the next start. On a real chain that deletes block files; regtest is too small to show it, so that step is from Core's code.
Related: #961 moved settings writes off the GUI thread. Shutdown ordering is tracked under #917.
Reproduced on merged
qt6ateed1f426fcb6, macOS / Qt 6.9, isolated regtest, offscreen and native. Focus and typing went through the test bridge, whose synthesized click does not focus the field. Quit, File → Exit and window close were bridge emulations; RPCstopand SIGTERM were real and gave the same result. No physical click, typing or Cmd+Q was done.