Browse Source

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.
pull/736/head
Jeremy Gallant 11 months ago
committed by GitHub
parent
commit
5b417a321a
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 4
      packages/web/src/components/Dialog/TracerouteResponseDialog.tsx
  2. 2
      packages/web/src/components/PageComponents/Messages/TraceRoute.tsx

4
packages/web/src/components/Dialog/TracerouteResponseDialog.tsx

@ -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;

2
packages/web/src/components/PageComponents/Messages/TraceRoute.tsx

@ -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")}

Loading…
Cancel
Save