{"record":{"id":"efd4f6b1bcb25599","repo":"gastownhall/beads","slug":"list-dep-metadata-w","errorCode":null,"errorMessage":"list dep metadata: %w","messagePattern":"list dep metadata: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/storage/domain/dependency.go","lineNumber":527,"sourceCode":"func (u *dependencyUseCaseImpl) IterWispWithIssueMetadata(ctx context.Context, wispID string, filter DepListFilter) (storage.Iter[types.IssueWithDependencyMetadata], error) {\n\treturn u.iterWithMetadata(ctx, wispID, filter, true)\n}\n\nfunc (u *dependencyUseCaseImpl) CountByWispID(ctx context.Context, wispID string, filter DepListFilter) (int64, error) {\n\treturn u.countByID(ctx, wispID, filter, true)\n}\n\nfunc (u *dependencyUseCaseImpl) listWithMetadata(ctx context.Context, sourceID string, filter DepListFilter, useWisp bool) ([]*types.IssueWithDependencyMetadata, error) {\n\tif sourceID == \"\" {\n\t\treturn nil, fmt.Errorf(\"list dep metadata: sourceID must not be empty\")\n\t}\n\tout, err := u.depRepo.ListWithIssueMetadata(ctx, sourceID, DepListOpts{\n\t\tTypes:         filter.Types,\n\t\tDirection:     filter.Direction,\n\t\tUseWispsTable: useWisp,\n\t})\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"list dep metadata: %w\", err)\n\t}\n\treturn out, nil\n}\n\nfunc (u *dependencyUseCaseImpl) iterWithMetadata(ctx context.Context, sourceID string, filter DepListFilter, useWisp bool) (storage.Iter[types.IssueWithDependencyMetadata], error) {\n\tif sourceID == \"\" {\n\t\treturn nil, fmt.Errorf(\"iter dep metadata: sourceID must not be empty\")\n\t}\n\tit, err := u.depRepo.IterWithIssueMetadata(ctx, sourceID, DepListOpts{\n\t\tTypes:         filter.Types,\n\t\tDirection:     filter.Direction,\n\t\tUseWispsTable: useWisp,\n\t})\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"iter dep metadata: %w\", err)\n\t}\n\treturn it, nil\n}","sourceCodeStart":509,"sourceCodeEnd":545,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/internal/storage/domain/dependency.go#L509-L545","documentation":"Wraps a repository failure from depRepo.ListWithIssueMetadata after the sourceID validation passed. The metadata-augmented dependency listing against the storage layer failed; the cause is preserved.","triggerScenarios":"Calling ListWithIssueMetadata or ListWispWithIssueMetadata with a valid non-empty sourceID where ListWithIssueMetadata on depRepo returns an error (for any UseWispsTable setting).","commonSituations":"DB unavailable or query timeout; source issue exists but the joined metadata query hits a schema mismatch after an upgrade; large dependency graphs exceeding query limits.","solutions":["Inspect the wrapped cause for connectivity vs schema errors","Verify migrations are current for the metadata join query","Retry with a valid context deadline","If using wisps variant, confirm the wisps table exists or fall back to the main listing"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"if sourceID == \"\" {\n\treturn fmt.Errorf(\"sourceID required\")\n}","typeGuard":null,"tryCatchPattern":"out, err := u.ListWithIssueMetadata(ctx, sourceID, filter)\nif err != nil {\n\tvar root error\n\terrors.As(err, &root)\n\t// root may be dberrors.TableNotExist for the wisp variant\n}","preventionTips":["Guard empty IDs before calling","Run migrations before schema-dependent joins","Use ListWispWithIssueMetadata only when wisps are enabled","Apply deadlines appropriate for large dependency graphs"],"tags":["storage","dependency","query","wrapped-error"],"backgroundTag":"dependency-query-failed","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}