From 2c93e25fafe90f81a90dc94a3363f789cd1723ea Mon Sep 17 00:00:00 2001 From: archipelago Date: Wed, 17 Jun 2026 07:06:08 -0400 Subject: [PATCH] fix(mesh): satisfy strict index access in federationContactId (#39 build) Destructure the first 4 pubkey bytes into typed locals so vue-tsc's noUncheckedIndexedAccess doesn't fail the build (the bytes.length<4 guard doesn't narrow per-element access). No behaviour change. Co-Authored-By: Claude Opus 4.8 (1M context) --- neode-ui/src/views/Mesh.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/neode-ui/src/views/Mesh.vue b/neode-ui/src/views/Mesh.vue index ab2094d1..3d896a8b 100644 --- a/neode-ui/src/views/Mesh.vue +++ b/neode-ui/src/views/Mesh.vue @@ -667,7 +667,8 @@ const mergedPeers = computed(() => { function federationContactId(pubkeyHex: string): number { const bytes = pubkeyHex.match(/../g)?.map(h => parseInt(h, 16)) ?? [] if (bytes.length < 4) return 0x80000001 - const low = ((bytes[0]) | (bytes[1] << 8) | (bytes[2] << 16) | (bytes[3] << 24)) >>> 0 + const [b0, b1, b2, b3] = bytes as [number, number, number, number] + const low = (b0 | (b1 << 8) | (b2 << 16) | (b3 << 24)) >>> 0 return ((0x80000000 | (low & 0x7fffffff)) >>> 0) }