Skip to content

Commit 1cad71a

Browse files
authored
fix: prevent duplicate traceroute pending records (#2364) (#2380)
1 parent ffe8a35 commit 1cad71a

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/server/meshtasticManager.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3817,12 +3817,16 @@ class MeshtasticManager {
38173817
}
38183818
}
38193819
// Preserve the 'from' and 'to' node order for virtual node traceroute requests.
3820-
// This ensures subsequent responses correctly correlate with this request
3820+
// This ensures subsequent responses correctly correlate with this request
38213821
// to update route and signal characteristics in the database.
3822+
// Skip if from our own node — sendTraceroute() already recorded the request.
38223823
else if (normalizedPortNum === PortNum.TRACEROUTE_APP) {
38233824
const fromNum = meshPacket.from ? Number(meshPacket.from) : 0;
38243825
const toNum = meshPacket.to ? Number(meshPacket.to) : 0;
3825-
await databaseService.recordTracerouteRequestAsync(fromNum, toNum);
3826+
const localNodeNum = this.localNodeInfo?.nodeNum;
3827+
if (fromNum !== localNodeNum) {
3828+
await databaseService.recordTracerouteRequestAsync(fromNum, toNum);
3829+
}
38263830
}
38273831
}
38283832
}

0 commit comments

Comments
 (0)