{"record":{"id":"c6db596b5ec6823b","repo":"gastownhall/beads","slug":"hydrate-issue-dependencies-w","errorCode":null,"errorMessage":"hydrate issue dependencies: %w","messagePattern":"hydrate issue dependencies: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/storage/uow/issue_operations.go","lineNumber":184,"sourceCode":"\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 {\n\t\tcomments := uw.CommentUseCase()\n\t\tif comments == nil {\n\t\t\treturn nil, fmt.Errorf(\"hydrate issue comments: comment use case is unavailable\")\n\t\t}\n\t\tif useWisp {\n\t\t\tclone.Comments, err = comments.GetCommentsForWisp(ctx, clone.ID)\n\t\t} else {\n\t\t\tclone.Comments, err = comments.GetCommentsForIssue(ctx, clone.ID)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"hydrate issue comments: %w\", err)\n\t\t}\n\t}\n\treturn storageissueops.CloneCreateRequest(publicops.CreateRequest{Issue: clone}).Issue, nil","sourceCodeStart":166,"sourceCodeEnd":202,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/internal/storage/uow/issue_operations.go#L166-L202","documentation":"hydrateIssueOperation fetches dependency records for the issue and wraps failures with 'hydrate issue dependencies:'. It also guards a nil dependency use case with a distinct message, meaning the unit of work was built without dependency support. Failures here abort the whole hydrate so responses never omit dependency data.","triggerScenarios":"GetWispDependencyRecords or GetIssueDependencyRecords returning an error during create/update/close hydration; or uw.DependencyUseCase() returning nil.","commonSituations":"Dependency tables missing or corrupted; wisp-plane routing choosing GetWispDependencyRecords when data lives on the issue plane; a UoW provider assembled without the dependency use case wired.","solutions":["Check the wrapped error for the underlying dependency-query failure.","If the message says the use case is unavailable, verify how the UnitOfWork provider is constructed and wire the dependency use case.","Retry the operation to rule out transient storage errors."],"exampleFix":"// before\nuw := provider.New(ctx) // dependency use case nil\n// after\nuw := provider.NewWithAllUseCases(ctx) // includes DependencyUseCase","handlingStrategy":"validation","validationCode":"// verify the UoW exposes a dependency use case before issuing updates\nif uw.DependencyUseCase() == nil { return errors.New(\"dependency use case unavailable\") }","typeGuard":null,"tryCatchPattern":"if err != nil {\n    if strings.Contains(err.Error(), \"dependency use case is unavailable\") { return rewireProvider() }\n    return retryOrSurface(err)\n}","preventionTips":["Assemble UnitOfWork providers with all use cases wired.","Match wisp vs issue plane routing to where data actually lives.","Validate dependency tables exist after migrations."],"tags":["hydration","dependencies","wiring"],"backgroundTag":"hydrate-read-failed","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}