{"record":{"id":"26db2f05e6fb501f","repo":"wavetermdev/waveterm","slug":"invalid-simple-id-format-s","errorCode":null,"errorMessage":"invalid simple id format: %s","messagePattern":"invalid simple id format: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/wshrpc/wshserver/resolvers.go","lineNumber":78,"sourceCode":"\t// check for [view]:N format\n\tif viewBlockRe.MatchString(simpleId) {\n\t\treturn \"view\", simpleId, nil\n\t}\n\n\t// Check for plain number (block reference)\n\tif _, err := strconv.Atoi(simpleId); err == nil {\n\t\treturn \"blocknum\", simpleId, nil\n\t}\n\n\t// Check for UUIDs\n\tif _, err := uuid.Parse(simpleId); err == nil {\n\t\treturn \"uuid\", simpleId, nil\n\t}\n\tif shortUUIDRe.MatchString(strings.ToLower(simpleId)) {\n\t\treturn \"uuid8\", simpleId, nil\n\t}\n\n\treturn \"\", \"\", fmt.Errorf(\"invalid simple id format: %s\", simpleId)\n}\n\n// Individual resolvers\nfunc resolveThis(ctx context.Context, data wshrpc.CommandResolveIdsData, value string) (*waveobj.ORef, error) {\n\tif data.BlockId == \"\" {\n\t\treturn nil, fmt.Errorf(\"no blockid in request\")\n\t}\n\n\tif value == SimpleId_This || value == SimpleId_Block {\n\t\treturn &waveobj.ORef{OType: waveobj.OType_Block, OID: data.BlockId}, nil\n\t}\n\tif value == SimpleId_Tab {\n\t\ttabId, err := wstore.DBFindTabForBlockId(ctx, data.BlockId)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"error finding tab: %v\", err)\n\t\t}\n\t\treturn &waveobj.ORef{OType: waveobj.OType_Tab, OID: tabId}, nil\n\t}","sourceCodeStart":60,"sourceCodeEnd":96,"githubUrl":"https://github.com/wavetermdev/waveterm/blob/a4447c1563b2df285ab89e76c82f91e1a1a49c1e/pkg/wshrpc/wshserver/resolvers.go#L60-L96","documentation":"parseSimpleId validates a user-provided simple id (like 'this', 'block', or a full/short UUID) before dispatching to per-type resolvers. This error is thrown when the string matches none of the known formats: it is neither a keyword nor a valid UUID/short-UUID. It is a client-input validation failure, not a lookup failure.","triggerScenarios":"Calling the ResolveIds command with a simpleId string that is not a recognized keyword ('this','block','tab','ws','workspace','wsh') and is not a valid full or 8-char short UUID — e.g. typos, URLs, object names, or truncated ids shorter than 8 chars.","commonSituations":"Users typing shortcuts in the command palette that aren't valid ids; scripts passing block names instead of UUIDs; copying an id and dropping characters; using a 6-char prefix where the regex requires 8.","solutions":["Pass one of the supported keywords (this/block/tab/ws/workspace) or a valid full/short UUID.","Validate the id with the shortUUIDRe/uuid pattern before sending.","Use tab completion or the UI's object picker to copy a correct id.","Check for whitespace or casing issues; short UUIDs are matched case-insensitively but other formats are not accepted."],"exampleFix":"// before\nresolveIds(ctx, \"blk-42\")\n// after\nresolveIds(ctx, \"a1b2c3d4\") // valid short UUID, or \"this\"/\"block\" keyword","handlingStrategy":"validation","validationCode":"var uuidRe = regexp.MustCompile(`^[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}$`)\nvar shortUUIDRe = regexp.MustCompile(`^[0-9a-fA-F]{8}$`)\nvar keywords = map[string]bool{\"this\":true,\"block\":true,\"tab\":true,\"ws\":true,\"workspace\":true,\"wsh\":true}\nfunc isValidSimpleId(s string) bool {\n    return keywords[s] || uuidRe.MatchString(s) || shortUUIDRe.MatchString(strings.ToLower(s))\n}","typeGuard":"func validSimpleId(s string) (string, bool) {\n    if keywords[s] || uuidRe.MatchString(s) || shortUUIDRe.MatchString(strings.ToLower(s)) {\n        return s, true\n    }\n    return \"\", false\n}","tryCatchPattern":"oref, err := wshclient.ResolveIdsCommand(ctx, wshrpc.CommandResolveIdsData{SimpleId: id, BlockId: blockId}, nil)\nif err != nil && strings.Contains(err.Error(), \"invalid simple id format\") {\n    return fmt.Errorf(\"%q is not a keyword or valid UUID: %w\", id, err)\n}","preventionTips":["Copy ids from the UI rather than typing them","Ensure short ids are exactly 8 hex chars","Match casing/whitespace before sending","Use the supported keyword set for symbolic ids"],"tags":["validation","input","uuid"],"backgroundTag":"invalid-id-format","analyzedSha":"a4447c1563b2df285ab89e76c82f91e1a1a49c1e","analyzedAt":"2026-09-01T15:26:23.972Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}