A trace to a companion turns at its last relay
A companion, a room server, or a sensor does not relay a trace with the firmware defaults (allowPacketForward in Mesh.cpp: client repeat is off, and allowed only on 433.000, 869.495, and 918.000 MHz; disable_fwd is on). A walk that turned at one of them never came home: the history held 36 companion traces and no reply from a real one. The route to such a node is the same. Only the walk changes: it turns at the last relay of the route, and the node is not in the spec. The route out of a walk that comes home is still the full route to the node, so the Device route row can offer it for DMs and admin. - relays_traces() in models states the rule. render_forced_spec takes relays=False, and forced_outbound reads the route back from a walk. - services/trace_plan holds the route choice that the trace screen made inline (radio route, outbound paths, best observed, last trace, direct), so the CLI uses the same one. - The trace screen names the relay where the walk turns, in a line under the route. With no relay to turn at, Trace is dim. A neighbour that does not relay gets "no relays" offered on the Device route row, with the packets heard directly as its proof. - The trace session turns a caller's spec (node page, Message paths) at the last relay, so the callers do not need the rule. A sender that is not a contact gets its type from its stored adverts. - The composer and Explore paths turn the walk at the last hop. - `meshterm trace -t NAME` with no --path walks the menu's route and says on stderr where it turns. With no known relay, it is a usage error. - The connection turns a device-routed trace at the last learned relay. The simulator now stops a walk at a node that does not relay, as the mesh does, and the tests that walked through Alice walk repeaters. The picker keeps one list with no mark, sorted as before (JP's choice). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
fe8a70d516
commit
d3166170ff
18 files changed
+1118
-229
No files matched your search
@@ -520,7 +520,7 @@ def test_a_trace_draws_its_route_with_arrows_and_keeps_its_path_in_commas(run) -
|
||||
name like each other hop. The ``★`` of the menu says "you already know who this is".
|
||||
This is true for the user, and it is not true for a person who opens the file later.
|
||||
"""
|
||||
result = run("trace-path", "--path", "a1,d4,a1")
|
||||
result = run("trace-path", "--path", "a1,b2,a1")
|
||||
assert result.exit_code == exitcodes.OK, result.output
|
||||
facts = dict(line.split(None, 1) for line in result_lines(result) if line and " " in line)
|
||||
assert facts["success"] == "yes"
|
||||
@@ -534,9 +534,23 @@ def test_a_trace_draws_its_route_with_arrows_and_keeps_its_path_in_commas(run) -
|
||||
assert "→" not in facts["path"]
|
||||
|
||||
|
||||
def test_a_trace_to_a_companion_turns_at_its_relay_and_says_so(run) -> None: # noqa: ANN001
|
||||
"""Alice is a companion, which stops a trace. The walk turns at her relay, Yagi-Repeater.
|
||||
|
||||
The CLI chooses the route as the menu does, and says on stderr where the walk turns.
|
||||
stdout keeps only the answer, with the walk in its ``path`` fact.
|
||||
"""
|
||||
result = run("trace", "--target", "Alice")
|
||||
assert result.exit_code in (exitcodes.OK, exitcodes.NO_RESULT), result.output
|
||||
assert "Alice can't relay a trace, so the trace turns at Yagi-Repeater" in result.stderr
|
||||
assert "relay a trace" not in result.stdout
|
||||
facts = dict(line.split(None, 1) for line in result_lines(result) if line and " " in line)
|
||||
assert "," not in facts["path"] and "a1b2c3d4".startswith(facts["path"])
|
||||
|
||||
|
||||
def test_a_trace_reports_its_per_hop_readings_under_a_header(run) -> None: # noqa: ANN001
|
||||
"""The second block has one record for each hop. The hash joins it to the route line."""
|
||||
lines = result_lines(run("trace-path", "--path", "a1,d4,a1"))
|
||||
lines = result_lines(run("trace-path", "--path", "a1,b2,a1"))
|
||||
header = next(line for line in lines if line.startswith("HOP"))
|
||||
assert header.split() == ["HOP", "FROM", "TO", "SNR_DB"]
|
||||
|
||||
|
||||
Reference in new issue
Block a user