luci: en/disable wifi also applies unrelated, queued changes
Today I locked myself out of a box and had to use failsafe to get back in because I queued up changes related to vlans and before I was done (did not press 'apply') with that I disabled one of my wifi stations using the buttons on the wifi configuration page. Those buttons apparently do a 'queue change, apply change without 90 seconds revert', as all my changes were applied and no rollback occurred after 90 s, locking me out of the machine.
Steps to reproduce:
- Make a change that pushes changes into a queue to be applied with the 'apply' button later.
- Switch to the wireless configuration page
- enable/disable any station using the button
Actual behavior:
- See all queued config applied, without revert after 90s of non-connection.
Expected behavior:
- enable/disable the selected interface, but leave all the other changes queued (not applied)
Additional Information:
DISTRIB_ID='OpenWrt' DISTRIB_RELEASE='23.05.0' DISTRIB_REVISION='r23497-6637af95aa' DISTRIB_TARGET='ramips/mt7621' DISTRIB_ARCH='mipsel_24kc' DISTRIB_DESCRIPTION='OpenWrt 23.05.0 r23497-6637af95aa' DISTRIB_TAINTS=''
I ran into this once before and forgot exactly what it was I did to trigger this. Good you logged this.
I can confirm that this exists.
Try this fix:
diff --git a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/wireless.js b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/wireless.js
index 80ab426a0e..18c03249cf 100644
--- a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/wireless.js
+++ b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/wireless.js
@@ -260,7 +260,7 @@ function network_updown(id, map, ev) {
}
return map.save().then(function() {
- ui.changes.apply()
+ ui.changes.apply(true)
});
}
@knarrff Have you been able to verify the proposed fix?
Sorry, this went below my radar. I'll try it - it does look promising from the look of it.
Have you tried this fix yet @knarrff
Try this fix:
diff --git a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/wireless.js b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/wireless.js index 80ab426a0e..18c03249cf 100644 --- a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/wireless.js +++ b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/wireless.js @@ -260,7 +260,7 @@ function network_updown(id, map, ev) { } return map.save().then(function() { - ui.changes.apply() + ui.changes.apply(true) }); }
@jow- I could not verify any behaviour difference when repeatedly testing this change on 23.05.2.
I lined up some harmless changes, and pressing enable/disable on the radio of a wifi network applied the changes immediately.
@systemcrash - this patch is not supposed to change that, it merely enables the same rollback protection as the normal apply button. Since wifi enabling/disabling is implemented as writing the option disabled setting into the wireless config and issuing a config reload, there's no way to isolate this operation from other pending uci changes.
it merely enables the same rollback protection as the normal apply button.
Not what I experienced. It counted down and applied those changes, no roll-back was available.
The rollback only happens if connectivity is lost.