Fix node mapping and unknown node display in traceroute dialogs (#728)

Corrects the mapping of 'from' and 'to' nodes in TracerouteResponseDialog to reflect the actual origin and destination of traceroute packets. Also updates TraceRoute to display a localized unknown name for node ID 4294967295 (0xffffff), improving clarity for unknown nodes.
This commit is contained in:
Jeremy Gallant
2025-07-24 03:31:05 +02:00
committed by GitHub
parent bbb43de87b
commit 5b417a321a
2 changed files with 3 additions and 3 deletions

View File

@@ -30,7 +30,7 @@ export const TracerouteResponseDialog = ({
const routeBack: number[] = traceroute?.data.routeBack ?? [];
const snrTowards = (traceroute?.data.snrTowards ?? []).map((snr) => snr / 4);
const snrBack = (traceroute?.data.snrBack ?? []).map((snr) => snr / 4);
const from = getNode(traceroute?.from ?? 0);
const from = getNode(traceroute?.to ?? 0); // The origin of the traceroute = the "to" node of the mesh packet
const fromLongName =
from?.user?.longName ??
(from ? `!${numberToHexUnpadded(from?.num)}` : t("unknown.shortName"));
@@ -40,7 +40,7 @@ export const TracerouteResponseDialog = ({
? `${numberToHexUnpadded(from?.num).substring(0, 4)}`
: t("unknown.shortName"));
const toUser = getNode(traceroute?.to ?? 0);
const toUser = getNode(traceroute?.from ?? 0); // The destination of the traceroute = the "from" node of the mesh packet
if (!toUser || !from) {
return null;

View File

@@ -41,7 +41,7 @@ const RoutePath = ({ title, from, to, path, snr }: RoutePathProps) => {
<span key={getNode(hop)?.num ?? hop}>
<p>
{getNode(hop)?.user?.longName ??
`${t("traceRoute.nodeUnknownPrefix")}${numberToHexUnpadded(hop)}`}
`${t("unknown.longName")} (!${numberToHexUnpadded(hop)})`}
</p>
<p>
{snr?.[i + 1] ?? t("unknown.num")}