Track advert path and use in mesh visualizer

This commit is contained in:
Jack Kingsman
2026-02-24 08:24:34 -08:00
parent c25b21469e
commit c30ed0b4bc
15 changed files with 579 additions and 33 deletions
+10
View File
@@ -34,6 +34,7 @@ from app.repository import (
ContactRepository,
MessageRepository,
RawPacketRepository,
RepeaterAdvertPathRepository,
)
from app.websocket import broadcast_error, broadcast_event
@@ -688,6 +689,15 @@ async def _process_advertisement(
advert.device_role if advert.device_role > 0 else (existing.type if existing else 0)
)
# Keep recent unique advert paths for repeaters to improve frontend identity hints.
if contact_type == CONTACT_TYPE_REPEATER:
await RepeaterAdvertPathRepository.record_observation(
repeater_key=advert.public_key.lower(),
path_hex=new_path_hex,
timestamp=timestamp,
max_paths_per_repeater=10,
)
contact_data = {
"public_key": advert.public_key.lower(),
"name": advert.name,