From 7e01b7e8c2ce2ef9fce8b6c053c3b7210b64f9bf Mon Sep 17 00:00:00 2001 From: Christophe Besson Date: Sat, 17 Oct 2026 18:51:35 +0200 Subject: fix(spa): search names the groups refused the local network Search gives up before ICE does, so the refusal is read from the connection then; the walk moves on to the group's other nodes, and the page lists the refused groups with a link to each. Co-Authored-By: Claude Opus 5.5 --- packages/meshbay-hub/tests/test_search_fanout.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'packages/meshbay-hub/tests/test_search_fanout.py') diff --git a/packages/meshbay-hub/tests/test_search_fanout.py b/packages/meshbay-hub/tests/test_search_fanout.py index 23a8b67d..73ba4ac0 100644 --- a/packages/meshbay-hub/tests/test_search_fanout.py +++ b/packages/meshbay-hub/tests/test_search_fanout.py @@ -50,7 +50,7 @@ import subprocess from pathlib import Path import pytest -from spa_source import search_argv +from spa_source import search_argv, search_source STATIC = Path(__file__).resolve().parents[1] / "src" / "meshbay_hub" / "static" SEARCH_PAGE = STATIC / "search-page.js" @@ -174,3 +174,18 @@ def test_no_more_groups_are_dialled_at_once_than_the_ceiling(): out = _sweep(groups=12, dead=list(range(12))) assert out["inFlight"] == 6 assert out["finishedAt"] == 2 * DEAD_MS + + +def test_a_group_refused_the_local_network_is_named_apart(): + """Not "unreachable": the page names these groups and says what to change, + and they are dialled last next time like any group that did not answer.""" + out = _sweep(groups=4, dead=[1, 2], lanRefused=[2]) + assert out["outcome"] == {"unreachable": ["G1"], "lanBlocked": ["G2"]}, out + assert sorted(out["remembered"]) == ["g-1", "g-2"], out + + +def test_the_search_page_shows_the_refused_groups_with_a_way_in(): + source = search_source() + start = source.index("lanBlocked.length > 0") + hint = source[start:start + 400] + assert "t('search.lan_blocked'" in hint and "groupLinkRoute(g)" in hint -- cgit v1.2.3