{"record":{"id":"491933e35703c0e3","repo":"jackwener/OpenCLI","slug":"messageid-v-is-not-a-full-uuid-short-id-hi","errorCode":null,"errorMessage":"messageId \"${v}\" is not a full UUID. ${SHORT_ID_HINT}","messagePattern":"messageId \"(.+?)\" is not a full UUID\\. (.+?)","errorType":"validation","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"clis/slock/resolve.js","lineNumber":43,"sourceCode":"    if (UUID_RE.test(rest)) return { kind: 'dm-uuid', userId: rest };\n    if (rest.startsWith('@')) return { kind: 'dm-name', name: rest.slice(1) };\n    throw new ArgumentError('dm target must be \"dm:<userId-uuid>\" or \"dm:@name\".');\n  }\n  const tt = classifyThreadTarget(v);\n  if (tt) return { kind: 'thread', ...tt };\n  if (UUID_RE.test(v)) return { kind: 'channel-uuid', channelId: v };\n  return { kind: 'channel-name', name: v.replace(/^#/, '').toLowerCase() };\n}\n\nconst SHORT_ID_HINT =\n  'short ids (the 8-hex `msg=...` form in channel headers) are NOT accepted — use the FULL UUID ' +\n  'from `bookmark-list` / `message-read` output.';\n\nexport function assertMessageIdShape(messageId) {\n  const v = String(messageId ?? '').trim();\n  if (!v) throw new ArgumentError('messageId required');\n  if (!UUID_RE.test(v)) {\n    throw new ArgumentError(`messageId \"${v}\" is not a full UUID. ${SHORT_ID_HINT}`);\n  }\n  return v;\n}\n\nexport function parsePositiveInteger(value, name, { defaultValue, max } = {}) {\n  const raw = value === undefined || value === null || value === '' ? defaultValue : value;\n  const n = parseStrictInteger(raw);\n  if (!Number.isInteger(n) || n <= 0 || (max !== undefined && n > max)) {\n    const suffix = max !== undefined ? ` between 1 and ${max}` : ' as a positive integer';\n    throw new ArgumentError(`${name} must be${suffix} (got \"${raw}\")`);\n  }\n  return n;\n}\n\nexport function parseNonNegativeInteger(value, name, { defaultValue } = {}) {\n  const raw = value === undefined || value === null || value === '' ? defaultValue : value;\n  const n = parseStrictInteger(raw);\n  if (!Number.isInteger(n) || n < 0) {","sourceCodeStart":25,"sourceCodeEnd":61,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/slock/resolve.js#L25-L61","documentation":"assertMessageIdShape enforces that messageId is a full UUID; any other non-empty string throws this ArgumentError including the offending value and a hint that 8-hex short ids from channel headers are NOT accepted. The message deliberately points to `bookmark-list` / `message-read` output as sources of full UUIDs.","triggerScenarios":"Passing the 8-hex short id (`msg=a1b2c3d4` shown in channel headers) as --messageId; passing Slack-style timestamps, numeric row ids, or partial UUIDs — anything failing UUID_RE.","commonSituations":"Copying the short id from a channel header because it's what's visible; mixing up message short ids and UUIDs across Slock UI versions; storing short ids in scripts/bookmarks and later feeding them to reaction/read commands; truncating a UUID when copying from a narrow terminal.","solutions":["Get the full UUID from `slock bookmark-list` or `slock message-read` output and use it for --messageId","Validate against the UUID pattern before invoking: /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/","Do not persist short ids in scripts — resolve to full UUIDs at capture time"],"exampleFix":"// before\n$ slock reaction-add --messageId a1b2c3d4 --emoji 👍\n// after\n$ slock message-read --channel general --limit 1   # read full UUID from output\n$ slock reaction-add --messageId a1b2c3d4-0000-1111-2222-333344445555 --emoji 👍","handlingStrategy":"validation","validationCode":"const UUID_RE = /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/;\nconst v = String(messageId ?? '').trim();\nif (v && !UUID_RE.test(v)) throw new Error(`messageId \"${v}\" is not a full UUID; short ids are not accepted`);","typeGuard":"function isFullUuid(v) {\n  return typeof v === 'string' &&\n    /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.test(v.trim());\n}","tryCatchPattern":"try {\n  await cli('message-read', { messageId });\n} catch (e) {\n  if (e instanceof ArgumentError && e.message.includes('not a full UUID')) {\n    console.error('Short ids from channel headers are rejected; re-resolve via bookmark-list or message-read.');\n  } else throw e;\n}","preventionTips":["Never store 8-hex short ids; resolve to full UUIDs at capture time","Source message UUIDs from bookmark-list/message-read output only","Run a UUID regex check wherever ids cross a script boundary","Copy UUIDs in full — verify 36 characters and 4 dash groups before use"],"tags":["argument-validation","uuid","input-validation"],"backgroundTag":"invalid-argument-format","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}