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 --- .../meshbay-hub/tests/harness/search_fanout_harness.mjs | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'packages/meshbay-hub/tests/harness/search_fanout_harness.mjs') diff --git a/packages/meshbay-hub/tests/harness/search_fanout_harness.mjs b/packages/meshbay-hub/tests/harness/search_fanout_harness.mjs index f84d90bc..27ad8757 100644 --- a/packages/meshbay-hub/tests/harness/search_fanout_harness.mjs +++ b/packages/meshbay-hub/tests/harness/search_fanout_harness.mjs @@ -23,6 +23,8 @@ const { // Indexes (0-based, in the hub's listing order) of the groups whose node is // down. They take `deadMs`; every other group answers in `liveMs`. dead = [], + // Of those, the ones whose node this device refused on the local network. + lanRefused = [], liveMs = 200, deadMs = 10000, // Group indexes the browser remembers as silent from a previous sweep. @@ -87,8 +89,12 @@ const fetchGroupIndex = (_pool, groupId) => new Promise((resolve, reject) => { const n = Number(String(groupId).split('-')[1]); const isDead = dead.includes(n); setTimeout( - () => (isDead ? reject(new Error('Connection timeout')) - : resolve({ entries: [{ id: `e${n}` }], roots: {} })), + () => { + if (!isDead) return resolve({ entries: [{ id: `e${n}` }], roots: {} }); + const err = new Error('Connection timeout'); + if (lanRefused.includes(n)) err.reason = 'local_network_blocked'; + return reject(err); + }, isDead ? deadMs : liveMs, ); }); @@ -125,11 +131,15 @@ const fetchAllIndexes = make( const list = Array.from({ length: groups }, (_, i) => ({ id: `g-${i}`, name: `G${i}` })); let finishedAt = null; +let outcome = null; fetchAllIndexes( null, list, 'tok', 'alice', 'u1', () => {}, // progress counters only (results) => { shown.push({ at: now, groups: results.size }); }, -).then(() => { finishedAt = now; }); +).then((out) => { + finishedAt = now; + outcome = { unreachable: out.unreachable, lanBlocked: out.lanBlocked.map((g) => g.name) }; +}); await run(runUntil); @@ -140,6 +150,7 @@ console.log(JSON.stringify({ // Every render, so a test can see whether live groups waited on dead ones. renders: shown, finishedAt, + outcome, inFlight: Number(ceiling[1]), // What the browser will remember for next time. remembered: written === null ? null : JSON.parse(written), -- cgit v1.2.3