{"record":{"id":"ebd7ebcbf42adcaa","repo":"qishibo/AnotherRedisDesktopManager","slug":"vector-is-required","errorCode":null,"errorMessage":"Vector is required","messagePattern":"Vector is required","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/components/contents/KeyContentVector.vue","lineNumber":355,"sourceCode":"        this.loadElementDetail(row.element).then((detail) => {\n          this.$set(this.editLineItem, 'vectorText', detail.vectorText);\n          this.$set(this.editLineItem, 'attrs', detail.attrs);\n        }).catch((e) => {\n          this.$message.error(e.message);\n        });\n      }\n    },\n    editLine() {\n      const before = this.beforeEditItem;\n      const element = (this.editLineItem.element || '').trim();\n      const vector = this.parseVectorText(this.editLineItem.vectorText);\n      const attrs = (this.editLineItem.attrs || '').trim();\n\n      if (!element) {\n        return this.$message.error('Element is required');\n      }\n      if (!vector || !vector.length) {\n        return this.$message.error('Vector is required');\n      }\n      if (this.dim && vector.length !== this.dim) {\n        return this.$message.error(`Vector dimension must be ${this.dim}`);\n      }\n      if (attrs && !this.$util.isJson(attrs)) {\n        return this.$message.error('Attributes must be valid JSON');\n      }\n\n      this.editDialog = false;\n\n      const vaddArgs = [this.redisKey, 'VALUES', vector.length, ...vector, element];\n      // must match existing set quant-type, otherwise: ERR asked quantization mismatch\n      const quantOpt = this.getQuantOption();\n      quantOpt && vaddArgs.push(quantOpt);\n\n      // set attributes\n      attrs && vaddArgs.push('SETATTR', attrs);\n","sourceCodeStart":337,"sourceCodeEnd":373,"githubUrl":"https://github.com/qishibo/AnotherRedisDesktopManager/blob/c149855106628babcdfb7675a8e7ba9434d2492a/src/components/contents/KeyContentVector.vue#L337-L373","documentation":"The vector text failed parseVectorText: either it is empty, or splitting on commas produced entries that are not finite numbers ('0.1;0.2', 'a,b', '0.1, , 0.3', localized '0,12', Infinity). No VADD is sent; this is purely client-side.","triggerScenarios":"Space- or semicolon-separated embeddings pasted from tensor output; empty slot between double commas; locale-formatted decimal commas; trailing comma.","commonSituations":"Copying vectors from Python/JS printouts, CSVs, or logs that use different separators; partial selection when copying a long embedding.","solutions":["Use comma-separated plain numbers: 0.12, 0.45, 0.78","Scan for double commas, stray letters, and convert decimal commas to points","Prefer the pre-filled vectorText from VEMB when editing an existing element"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const parts = text.split(',').map((p) => Number(p.trim()));\nif (!text.trim() || parts.some((n) => !Number.isFinite(n))) {\n  return this.$message.error('Vector must be comma-separated finite numbers');\n}","typeGuard":"const isNumericVector = (text) => {\n  if (typeof text !== 'string' || !text.trim()) return false;\n  return text.split(',').every((p) => Number.isFinite(Number(p.trim())));\n};","tryCatchPattern":null,"preventionTips":["Parse and validate the vector before constructing VADD args — server-side rejection is worse feedback than a client-side message","Reject non-finite components explicitly; Number('') is 0 and silently shifts bad data","Show the expected input format (comma-separated floats) next to the field"],"tags":["validation","vector-sets","numeric-input","form"],"backgroundTag":"invalid-numeric-input","analyzedSha":"c149855106628babcdfb7675a8e7ba9434d2492a","analyzedAt":"2026-08-22T09:06:28.613Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}