From d6cde255046699d43051ad34a7d25ac6a0412a21 Mon Sep 17 00:00:00 2001 From: Arnaud Nelissen Date: Sun, 28 Jun 2026 01:29:24 +0200 Subject: [PATCH] fix: use serial positions 6-11 for module slug instead of last 6 chars MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Serial format is PPPPPP+SSSSSS+0001 — slice(-6) was picking up the trailing 0001 suffix. slice(6,12) gives the correct device identifier. Co-Authored-By: Claude Sonnet 4.6 --- src/registry.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/registry.js b/src/registry.js index 2341b23..e06788a 100644 --- a/src/registry.js +++ b/src/registry.js @@ -10,7 +10,9 @@ const USER_ID = process.env.SOLEM_USER_ID || '5de53bca7ed4c45c2cfe067f'; const registry = new Map(); function makeSlug(type, serial) { - const suffix = (serial || '').slice(-6).toLowerCase(); + // Serial format: PPPPPP SSSSSS 0001 — device identifier is at positions 6-11 + const s = serial || ''; + const suffix = (s.length >= 12 ? s.slice(6, 12) : s.slice(-6)).toLowerCase(); return `${type}_${suffix}`.replace(/[^a-z0-9_]/g, '_'); }