From a6c64279e85e44f30e20042f1587f8bb505b3c82 Mon Sep 17 00:00:00 2001 From: Jack Kingsman Date: Wed, 8 Jul 2026 14:09:08 -0700 Subject: [PATCH] Plumb through total neighbor count from radio and expose that in the UI. Closes #310. --- app/models.py | 8 +++++ app/routers/repeaters.py | 3 +- .../repeater/RepeaterNeighborsPane.tsx | 8 ++++- frontend/src/types.ts | 4 +++ tests/test_repeater_routes.py | 29 +++++++++++++++++++ 5 files changed, 50 insertions(+), 2 deletions(-) diff --git a/app/models.py b/app/models.py index a2315c3..42efecc 100644 --- a/app/models.py +++ b/app/models.py @@ -672,6 +672,14 @@ class RepeaterNeighborsResponse(BaseModel): neighbors: list[NeighborInfo] = Field( default_factory=list, description="List of neighbors seen by repeater" ) + reported_count: int | None = Field( + default=None, + description=( + "Total neighbor count reported by the repeater firmware, independent of " + "how many entries were actually returned. May exceed len(neighbors) when a " + "multi-chunk fetch is incomplete (dropped follow-up query / duty-cycle throttle)." + ), + ) class RepeaterAclResponse(BaseModel): diff --git a/app/routers/repeaters.py b/app/routers/repeaters.py index 7317b84..2eaedfe 100644 --- a/app/routers/repeaters.py +++ b/app/routers/repeaters.py @@ -265,7 +265,8 @@ async def repeater_neighbors(public_key: str) -> RepeaterNeighborsResponse: ) ) - return RepeaterNeighborsResponse(neighbors=neighbors) + reported_count = neighbors_data.get("neighbours_count") if neighbors_data else None + return RepeaterNeighborsResponse(neighbors=neighbors, reported_count=reported_count) @router.post("/{public_key}/repeater/acl", response_model=RepeaterAclResponse) diff --git a/frontend/src/components/repeater/RepeaterNeighborsPane.tsx b/frontend/src/components/repeater/RepeaterNeighborsPane.tsx index 2947687..157d572 100644 --- a/frontend/src/components/repeater/RepeaterNeighborsPane.tsx +++ b/frontend/src/components/repeater/RepeaterNeighborsPane.tsx @@ -203,7 +203,13 @@ export function NeighborsPane({ return (