{"record":{"id":"7c90f7ee056efe54","repo":"wavetermdev/waveterm","slug":"error-parsing-object-reference-w","errorCode":null,"errorMessage":"error parsing object reference: %w","messagePattern":"error parsing object reference: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/service/objectservice/objectservice.go","lineNumber":127,"sourceCode":"\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error deleting block: %w\", err)\n\t}\n\treturn waveobj.ContextGetUpdatesRtn(ctx), nil\n}\n\nfunc (svc *ObjectService) UpdateObjectMeta_Meta() tsgenmeta.MethodMeta {\n\treturn tsgenmeta.MethodMeta{\n\t\tArgNames: []string{\"uiContext\", \"oref\", \"meta\"},\n\t}\n}\n\nfunc (svc *ObjectService) UpdateObjectMeta(uiContext waveobj.UIContext, orefStr string, meta waveobj.MetaMapType) (waveobj.UpdatesRtnType, error) {\n\tctx, cancelFn := context.WithTimeout(context.Background(), DefaultTimeout)\n\tdefer cancelFn()\n\tctx = waveobj.ContextWithUpdates(ctx)\n\toref, err := parseORef(orefStr)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error parsing object reference: %w\", err)\n\t}\n\terr = wstore.UpdateObjectMeta(ctx, *oref, meta, false)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error updating %q meta: %w\", orefStr, err)\n\t}\n\treturn waveobj.ContextGetUpdatesRtn(ctx), nil\n}\n\nfunc (svc *ObjectService) UpdateObject_Meta() tsgenmeta.MethodMeta {\n\treturn tsgenmeta.MethodMeta{\n\t\tArgNames: []string{\"uiContext\", \"waveObj\", \"returnUpdates\"},\n\t}\n}\n\nfunc (svc *ObjectService) UpdateObject(uiContext waveobj.UIContext, waveObj waveobj.WaveObj, returnUpdates bool) (waveobj.UpdatesRtnType, error) {\n\tctx, cancelFn := context.WithTimeout(context.Background(), DefaultTimeout)\n\tdefer cancelFn()\n\tctx = waveobj.ContextWithUpdates(ctx)","sourceCodeStart":109,"sourceCodeEnd":145,"githubUrl":"https://github.com/wavetermdev/waveterm/blob/a4447c1563b2df285ab89e76c82f91e1a1a49c1e/pkg/service/objectservice/objectservice.go#L109-L145","documentation":"UpdateObjectMeta wraps parseORef failures with 'error parsing object reference: %w'. The orefStr argument was not a valid 'type:oid' reference (see parseORef: must split on ':' into exactly 2 fields), so meta update never started. The inner error is 'invalid object reference: %q'.","triggerScenarios":"Calling UpdateObjectMeta with a bare OID, empty string, a ref containing multiple colons, or a decorated identifier like 'wave://block:id'.","commonSituations":"Hand-assembling the oref string in frontend code; passing a full meta JSON or block id where a full ORef string is expected; logging formats that prefix the ref.","solutions":["Pass exactly 'type:oid' (e.g. 'block:B123') with a single ':'","Validate the format with a split(':') check before the call","Generate the ref with waveobj ORef string helpers instead of concatenation"],"exampleFix":"// before\nsvc.UpdateObjectMeta(uiContext, blockId, meta)\n// after\norefStr := (waveobj.ORef{OType: waveobj.OType_Block, OID: blockId}).String()\nsvc.UpdateObjectMeta(uiContext, orefStr, meta)","handlingStrategy":"validation","validationCode":"if len(strings.Split(orefStr, \":\")) != 2 { return fmt.Errorf(\"oref must be type:oid\") }","typeGuard":"func isWellFormedORef(s string) bool { p := strings.Split(s, \":\"); return len(p) == 2 && p[0] != \"\" && p[1] != \"\" }","tryCatchPattern":"if err := validateORefFormat(orefStr); err != nil { return err }\n_, err := svc.UpdateObjectMeta(uiContext, orefStr, meta)\nif err != nil { return err }","preventionTips":["Construct orefs with ORef helpers instead of string building","Validate 'type:oid' format at API boundaries","Do not pass bare ids or URIs where an oref string is expected"],"tags":["go","validation","oref","meta"],"backgroundTag":"invalid-object-reference","analyzedSha":"a4447c1563b2df285ab89e76c82f91e1a1a49c1e","analyzedAt":"2026-09-01T15:26:23.972Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}