{"record":{"id":"1fa79074abf8e646","repo":"gastownhall/beads","slug":"hydrate-issue-comments-w","errorCode":null,"errorMessage":"hydrate issue comments: %w","messagePattern":"hydrate issue comments: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/storage/uow/issue_operations.go","lineNumber":199,"sourceCode":"\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\n}\n\n// Update updates one issue in a retried unit-of-work transaction.\nfunc (o *issueOperations) Update(ctx context.Context, request publicops.UpdateRequest) (publicops.UpdateResult, error) {\n\tsnapshot := storageissueops.CloneUpdateRequest(request)\n\tif err := validateUpdateRequest(snapshot); err != nil {\n\t\treturn publicops.UpdateResult{}, err\n\t}\n\treturn RunTxResult(ctx, o.provider, func(ctx context.Context, uw UnitOfWork) (publicops.UpdateResult, string, error) {\n\t\tattempt := storageissueops.CloneUpdateRequest(snapshot)\n\t\tspec, err := updateSpec(attempt)\n\t\tif err != nil {\n\t\t\treturn publicops.UpdateResult{}, \"\", validationError(err)\n\t\t}\n\t\tbefore, _, err := operationIssue(ctx, uw, attempt.IssueID, attempt.IssuePlaneOnly)","sourceCodeStart":181,"sourceCodeEnd":217,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/internal/storage/uow/issue_operations.go#L181-L217","documentation":"When includeComments is true, hydrateIssueOperation loads the issue's comments and wraps failures with 'hydrate issue comments:'. Comments are optional in the payload but explicitly requested ones must load fully or the operation errors. Failures come from GetCommentsForIssue or GetCommentsForWisp depending on which plane the issue lives on.","triggerScenarios":"Create/Update/Close called with comments requested, and the comment query errors while the issue sits on the wisp or issue plane.","commonSituations":"Comment tables unavailable or corrupted; plane mismatch (wisp vs issue) after a storage-mode change; transient DB failure mid-transaction.","solutions":["Inspect the wrapped inner error for the actual comment-query failure.","Retry the verb; transient storage errors resolve on re-run of the UoW transaction.","If comments are not needed, call the operation without requesting comments to skip this path."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err != nil {\n    if isTransientStorage(err) { return retryVerb() }\n    return err\n}","preventionTips":["Only request comments when the caller needs them.","Retry the verb on transient failures.","Check comment-plane routing after storage-mode changes."],"tags":["hydration","comments","storage"],"backgroundTag":"hydrate-read-failed","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}