Skip to content

Confirm Label_SQ is the only decoder with non-number version string; fix it#367

Closed
Copilot wants to merge 1 commit intoclaude/improve-library-architecture-6SsF3from
copilot/sub-pr-366
Closed

Confirm Label_SQ is the only decoder with non-number version string; fix it#367
Copilot wants to merge 1 commit intoclaude/improve-library-architecture-6SsF3from
copilot/sub-pr-366

Conversation

Copy link

Copilot AI commented Mar 19, 2026

RawFields.version is typed as number, but Label_SQ was assigning it directly from String.prototype.substring, producing a string and comparing with === '2'. Investigation confirmed this was the only decoder with this inconsistency — all others set raw.version via ResultFormatter.version(), which stores a number.

Changes

  • Label_SQ: Wrap substring extraction with Number() and update comparison from === '2' to === 2; convert to string only at the display layer (String(decodeResult.raw.version))
// Before
decodeResult.raw.version = message.text.substring(1, 2); // string
if (decodeResult.raw.version === '2') { ... }
value: decodeResult.raw.version,

// After
decodeResult.raw.version = Number(message.text.substring(1, 2)); // number
if (decodeResult.raw.version === 2) { ... }
value: String(decodeResult.raw.version),

🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Copilot AI changed the title [WIP] [WIP] Address feedback on MessageDecoder refactor regarding non-number strings Confirm Label_SQ is the only decoder with non-number version string; fix it Mar 19, 2026
Copilot AI requested a review from kevinelliott March 19, 2026 02:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants