{"record":{"id":"8a447f9988461064","repo":"gastownhall/beads","slug":"getforissueids-w","errorCode":null,"errorMessage":"GetForIssueIDs: %w","messagePattern":"GetForIssueIDs: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/storage/domain/dependency.go","lineNumber":485,"sourceCode":"func (u *dependencyUseCaseImpl) ListWithIssueMetadata(ctx context.Context, issueID string, filter DepListFilter) ([]*types.IssueWithDependencyMetadata, error) {\n\treturn u.listWithMetadata(ctx, issueID, filter, false)\n}\n\nfunc (u *dependencyUseCaseImpl) IterWithIssueMetadata(ctx context.Context, issueID string, filter DepListFilter) (storage.Iter[types.IssueWithDependencyMetadata], error) {\n\treturn u.iterWithMetadata(ctx, issueID, filter, false)\n}\n\nfunc (u *dependencyUseCaseImpl) CountByIssueID(ctx context.Context, issueID string, filter DepListFilter) (int64, error) {\n\treturn u.countByID(ctx, issueID, filter, false)\n}\n\nfunc (u *dependencyUseCaseImpl) GetForIssueIDs(ctx context.Context, ids []string) (map[string][]*types.Dependency, error) {\n\tif len(ids) == 0 {\n\t\treturn map[string][]*types.Dependency{}, nil\n\t}\n\tissueRes, err := u.depRepo.ListByIssueIDs(ctx, ids, DepListOpts{Direction: DepDirectionOut})\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"GetForIssueIDs: %w\", err)\n\t}\n\tout := issueRes.Outgoing\n\tif out == nil {\n\t\tout = make(map[string][]*types.Dependency)\n\t}\n\twispRes, err := u.depRepo.ListByIssueIDs(ctx, ids, DepListOpts{Direction: DepDirectionOut, UseWispsTable: true})\n\tif err != nil && !dberrors.IsTableNotExist(err) {\n\t\treturn nil, fmt.Errorf(\"GetForIssueIDs (wisps): %w\", err)\n\t}\n\tfor id, deps := range wispRes.Outgoing {\n\t\tout[id] = append(out[id], deps...)\n\t}\n\treturn out, nil\n}\n\nfunc (u *dependencyUseCaseImpl) ListByWispIDs(ctx context.Context, wispIDs []string, filter DepListFilter) (DepBulkResult, error) {\n\treturn u.list(ctx, wispIDs, filter, true)\n}","sourceCodeStart":467,"sourceCodeEnd":503,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/internal/storage/domain/dependency.go#L467-L503","documentation":"Wraps a failure from depRepo.ListByIssueIDs when listing outgoing dependencies for a batch of issue IDs from the main (non-wisp) table. GetForIssueIDs builds a per-issue dependency map and this is the first lookup step. Any non-empty-id input reaching a failing repository call produces this error.","triggerScenarios":"Calling GetForIssueIDs with a non-empty ids slice where ListByIssueIDs with Direction DepDirectionOut (main table) returns an error.","commonSituations":"Database unreachable or schema migration missing; passing malformed/very large ID batches; context timeout during the query.","solutions":["Read the wrapped repository error for the root cause","Retry with a smaller id batch if query size limits are suspected","Verify DB connectivity and that migrations created the dependencies table","Ensure the context has an adequate deadline"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"if len(ids) == 0 {\n\t// API already returns an empty map; skip the call\n}","typeGuard":null,"tryCatchPattern":"depsByIssue, err := u.GetForIssueIDs(ctx, ids)\nif err != nil {\n\tif dberrors.IsTableNotExist(errors.Unwrap(err)) {\n\t\t// missing migration; run migrations then retry\n\t}\n\treturn fmt.Errorf(\"loading deps: %w\", err)\n}","preventionTips":["Drop empty IDs from the batch before calling","Keep migrations current so the dependencies table exists","Batch large ID lists into chunks","Use a context with a reasonable timeout"],"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"}