{"record":{"id":"418fcd5a9cbda24e","repo":"gastownhall/beads","slug":"hydrate-issue-labels-w","errorCode":null,"errorMessage":"hydrate issue labels: %w","messagePattern":"hydrate issue labels: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/storage/uow/issue_operations.go","lineNumber":170,"sourceCode":"\tstored, useWisp, err := operationIssue(ctx, uw, issue.ID, issuePlaneOnly)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"hydrate issue operation: %w\", err)\n\t}\n\tclone := storageissueops.CloneCreateRequest(publicops.CreateRequest{Issue: stored}).Issue\n\tif !includeComments {\n\t\tclone.Comments = nil\n\t}\n\tlabels := uw.LabelUseCase()\n\tif labels == nil {\n\t\treturn nil, fmt.Errorf(\"hydrate issue labels: label use case is unavailable\")\n\t}\n\tif useWisp {\n\t\tclone.Labels, err = labels.GetWispLabels(ctx, clone.ID)\n\t} else {\n\t\tclone.Labels, err = labels.GetLabels(ctx, clone.ID)\n\t}\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"hydrate issue labels: %w\", err)\n\t}\n\n\tdependencies := uw.DependencyUseCase()\n\tif dependencies == nil {\n\t\treturn nil, fmt.Errorf(\"hydrate issue dependencies: dependency use case is unavailable\")\n\t}\n\tvar records map[string][]*types.Dependency\n\tif useWisp {\n\t\trecords, err = dependencies.GetWispDependencyRecords(ctx, []string{clone.ID})\n\t} else {\n\t\trecords, err = dependencies.GetIssueDependencyRecords(ctx, []string{clone.ID})\n\t}\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"hydrate issue dependencies: %w\", err)\n\t}\n\tclone.Dependencies = records[clone.ID]\n\n\tif includeComments {","sourceCodeStart":152,"sourceCodeEnd":188,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/internal/storage/uow/issue_operations.go#L152-L188","documentation":"After loading the stored issue, hydrateIssueOperation fetches its labels (from the wisp or issue plane as appropriate) and wraps failures with 'hydrate issue labels:'. The response payload includes labels, so a label-read failure aborts hydration. This keeps partial (label-less) issues from being silently returned to callers.","triggerScenarios":"GetLabels or GetWispLabels failing while hydrating a created/updated/closed issue — typically a query error or connectivity problem against the labels table.","commonSituations":"Database locked/unavailable mid-transaction; schema mismatch after a version upgrade; label use case misconfigured in the unit of work.","solutions":["Read the wrapped error to identify the underlying label-query failure.","Retry the operation; the UoW transaction model supports re-running the verb.","Verify the labels tables/schema are intact (e.g. after an upgrade run migrations/doctor)."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err != nil && strings.Contains(err.Error(), \"hydrate issue labels\") {\n    return retryWithBackoff(op)\n}","preventionTips":["Retry transient storage failures at the verb level.","Run schema checks after upgrades so label tables stay valid.","Alert on repeated label-read failures as a storage health signal."],"tags":["hydration","labels","storage"],"backgroundTag":"hydrate-read-failed","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}