Repository navigation
Drop a stale Wi-Fi failure once NetworkManager connects that network - #15367
aholbreich wants to merge 2 commits into
Conversation
A failed connect from the network panel stores its reason on the row. Only a new click, a panel-started action completing, or the passphrase prompt timer cleared it, so when NetworkManager autoconnected the network later the row kept showing "Network lost" over "Connected". checkActionCompletion() now drops the failure when the failed network reports connected, before its in-flight-action guard. It runs for every network on refresh and on the row's connected-state change, so reopening the panel or a live reconnect both clear it. Fixes omacom#15341 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
checkActionCompletion now drops any failure on a connected network, but refresh() runs it straight after actionTimeout records "Timed out disconnecting" or "Timed out forgetting" on a network that is still connected, so those were cleared before they were drawn. Record which action failed and clear only a failed connect. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks for this, Alexander. I reviewed it and ran it on a worker built from the Omarchy ISO, with the shell running from this branch. The bug is real, and this fixes it. I wrote my own check that runs the panel's own One regression, which I fixed and pushed as 1cb81c8. Tests on the worker: Second opinion: Codex Medium reviewed the branch at 1cb81c8 and found no defects. It agreed that the Fixes #15341, which is already linked. This is now waiting on the maintainer. The unrelated shell test failures are the one thing keeping it from being marked ready. |
[Low impact] The PR appears safe to merge. SummaryClears an old Wi-Fi connection failure when NetworkManager later connects that network.
Reviews (1) · Last reviewed commit: "Keep a timed-out disconnect or forget on..." · Reviewed by Greptile |
* Keep Wi-Fi rows in step with NetworkManager The rows are primitive snapshots, rebuilt only when the list of networks changes, when the panel opens, or when one of its own actions completes. A listed network that connects, drops, is saved or is forgotten by anything else -- autoconnect, nmcli, another settings tool -- changes state without changing the list, so the rows kept showing the old state until the panel was reopened: a dropped network still "Connected", a connected one under Other Networks, a saved one asking for its password, a forgotten one under Known Networks. The panel now binds a key over every listed network's state at the root and rebuilds the rows when it changes. Bound at the root, it also sees networks that have no delegate, so it replaces the per-row completion handlers, which missed rows scrolled out of view and everything while the panel was closed. The rebuild leaves identical rows in place, since a new model takes focus from a passphrase being typed, and keeps the cursor on its network through the re-sort. An action whose outcome already holds settles at once, where it used to wait for a change that never came and time out. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Track the enterprise reconnect, and follow a hidden row The immediate settle exists because Quickshell ignores connect() on a connected network and disconnect() on a disconnected one, so those calls can never signal. The enterprise script is different: it creates a profile and brings it up even when the network is already connected, so settling at once would drop its busy state and the failure it may report. The cursor marked "no row" with "", which is also a hidden network's SSID, so a selected hidden row was left behind when the list re-sorted. It now uses null. The fixture now drives a disconnect that completes only once stateChanging clears, which is the only thing keeping stateChanging in the key, and checks the in-flight connect is the one it started. Co-Authored-By: Codex Medium <noreply@openai.com> Co-Authored-By: Muse Wonder High <noreply@meta.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Drop a failed connect's reason once NetworkManager connects that network A panel connect that fails or times out leaves its reason on the row. When NetworkManager later connects that network on its own -- the access point comes back, the radio returns -- no action is in flight, so nothing cleared it, and the row read "Timed out connecting" or "Network lost" under a connected header. checkActionCompletion now drops the failure once the network that failed reports connected, before its in-flight guard, and only for a failed connect, since a timed-out disconnect leaves the network connected. The root state key makes it run whenever that network's connected flag changes. This is the fix proposed in #15367. Co-Authored-By: Alexander Holbreich <16252784+aholbreich@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Settle before acting, and clear a failure only once its network settles An action whose network is already in the asked-for state now settles before its call is made instead of after. For connect(), connectWithPsk() and disconnect() nothing changes, since Quickshell ignores those calls then. For the enterprise script it does: it creates a profile and brings it up, so started against a live connection it would run untracked once the next rebuild saw the old link still connected, and a failure of it would be erased by that same link. The failure clear now waits for the network to stop changing state, as the disconnect and forget checks already do, so a connection that is still coming up and then fails does not take the explanation with it. It also closes a passphrase reprompt opened for that network, which would otherwise sit open over a connected row. Co-Authored-By: Codex Medium <noreply@openai.com> Co-Authored-By: Muse Wonder High <noreply@meta.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Close only the completed network's passphrase prompt A connect that settles closed whatever prompt was open. Now that a connect to an already-connected network settles before anything is asked, a stale row clicked while another network's prompt is open would throw away the passphrase being typed there. Co-Authored-By: Muse Wonder High <noreply@meta.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Close a passphrase prompt once its network connects, error or not The prompt was closed only from the failure clear, which needs the failure text. The row's failureTimer clears that text two seconds into a reprompt, so a reconnect after that left the prompt open over the connected network, as did one with no failure behind it at all. A prompt only opens for a network that is not connected, so once that network is connected and settled there is nothing left to ask. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Omarchybot <317366263+omarchybot@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Codex Medium <noreply@openai.com> Co-authored-by: Muse Wonder High <noreply@meta.com> Co-authored-by: Alexander Holbreich <16252784+aholbreich@users.noreply.github.com>
Fixes #15341.
Problem. When a connect started from the network panel fails (e.g.
ssid-not-found), the row shows the failure ("Network lost"). If NetworkManager later autoconnects that same network on its own, the row keeps the red failure text while the header shows it connected, until the network is clicked again or the shell restarts. Reopening the panel doesn't help.Cause.
failNetworkAction()storesfailureSsid/failureReason. They are cleared only by a new panel action, byclearNetworkAction()(reached throughcheckActionCompletion(), which returns early when no action is in flight), or byfailureTimerwhile the passphrase prompt is open.statusTextchecksisFailedbeforeisConnected, so the stale reason wins.Fix.
checkActionCompletion()drops the failure when the failed network reports connected, before its in-flight-action guard. It already runs for every network on refresh (panel open) and on the row's connected-state change, so no new wiring is needed.Tests. New case in
test/shell.d/network-test.shruns the panel's ownfailNetworkAction,checkActionCompletionandclearNetworkActionagainst stand-in networks: the failure survives while another network is connected or the failed one is still down, and clears once it connects. It fails onquattroand passes with the fix.network-test.sh124/124; the other network suites (password, captive portal, manager transition, QR) pass unchanged. The full./test/shellsuite was not run (the change is limited tocheckActionCompletion()), and it was not tested against a live NetworkManager.🤖 Generated with Claude Code