captive portal: let acknowledged clients finish so the OS offers "Done"

A phone's sign-in sheet only shows "Done" once the OS re-probes and gets
the genuine success reply.  The Controller now remembers each client (by
hotspot IP) that has loaded the portal page and answers its later probes
with the reply each OS expects (Apple "Success" HTML, Android 204, Windows
"Microsoft Connect Test", ...).  The set is cleared when the hotspot
starts so a new session shows the page again.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
Roland 2026-09-13 19:48:13 -06:00
parent 66151df6c6
commit f182e64e17
No known key found for this signature in database
GPG key ID: 1BA620CE6C9A4680
7 changed files with 108 additions and 15 deletions

View file

@ -1089,6 +1089,13 @@ class TestStartHotspot:
assert 'address=/captive.apple.com/10.42.1.1' in captive_portal.INCLUDE_FILE.read_text()
assert run.call_args_list[-1][0][0] == ["nmcli", "connection", "up", "Hotspot"]
def test_start_forgets_acknowledged_clients(self, reset_runtime_config):
"""A new hotspot session shows every device the portal page again."""
captive_portal.acknowledge_client('10.42.0.210')
result, _ = self._start_with_nmcli()
assert result["success"] is True
assert not captive_portal.is_client_acknowledged('10.42.0.210')
def test_no_reactivation_when_ip_matches(self, reset_runtime_config):
result, run = self._start_with_nmcli()
ups = [c for c in run.call_args_list if c[0][0][:3] == ['nmcli', 'connection', 'up']]