mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-11-22 16:06:19 -05:00
controller: address hotspot protocol review findings
- Reset a saved protocol the newly probed device does not support instead of offering it (both UIs); a successful probe is authoritative, the saved value is only kept when probing fails. - Ignore out-of-order protocol probe responses when switching devices quickly (both UIs). - Verify the WPA2 rollback after a failed WPA3 activation; report that the hotspot may be down instead of claiming the revert succeeded. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
8687816b84
commit
2baa9cbd2e
5 changed files with 67 additions and 12 deletions
|
|
@ -1451,16 +1451,32 @@ function HotspotSettingsForm() {
|
|||
if (!form.device) {
|
||||
return;
|
||||
}
|
||||
// Ignore out-of-order responses when the user switches devices quickly.
|
||||
let cancelled = false;
|
||||
const fetchProtocols = async () => {
|
||||
try {
|
||||
const response = await getHotspotProtocols(form.device);
|
||||
setProtocols(response.protocols || []);
|
||||
if (cancelled) {
|
||||
return;
|
||||
}
|
||||
const supported = response.protocols || [];
|
||||
setProtocols(supported);
|
||||
// Reset a selection the probed device does not support (e.g. WPA3 kept
|
||||
// after switching to a WPA2-only adapter).
|
||||
if (supported.length) {
|
||||
setForm(f => supported.includes(f.protocol) ? f : {...f, protocol: supported[0]});
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('Failed to fetch hotspot protocols', e);
|
||||
setProtocols([]);
|
||||
if (!cancelled) {
|
||||
console.error('Failed to fetch hotspot protocols', e);
|
||||
setProtocols([]);
|
||||
}
|
||||
}
|
||||
};
|
||||
fetchProtocols();
|
||||
return () => {
|
||||
cancelled = true;
|
||||
};
|
||||
}, [form.device]);
|
||||
|
||||
const handleSave = async () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue