{"record":{"id":"8d86c7c3c7dea092","repo":"gastownhall/beads","slug":"getforissueids-wisps-w","errorCode":null,"errorMessage":"GetForIssueIDs (wisps): %w","messagePattern":"GetForIssueIDs \\(wisps\\): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/storage/domain/dependency.go","lineNumber":493,"sourceCode":"func (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}\n\nfunc (u *dependencyUseCaseImpl) ListWispWithIssueMetadata(ctx context.Context, wispID string, filter DepListFilter) ([]*types.IssueWithDependencyMetadata, error) {\n\treturn u.listWithMetadata(ctx, wispID, filter, true)\n}\n\nfunc (u *dependencyUseCaseImpl) IterWispWithIssueMetadata(ctx context.Context, wispID string, filter DepListFilter) (storage.Iter[types.IssueWithDependencyMetadata], error) {\n\treturn u.iterWithMetadata(ctx, wispID, filter, true)\n}","sourceCodeStart":475,"sourceCodeEnd":511,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/internal/storage/domain/dependency.go#L475-L511","documentation":"Wraps a failure from depRepo.ListByIssueIDs against the wisps table — but only for errors that are NOT dberrors.IsTableNotExist. A missing wisps table is tolerated (returns empty), so this error means a real failure occurred while reading wisp dependencies.","triggerScenarios":"Calling GetForIssueIDs where the wisps-table ListByIssueIDs returns an error other than TableNotExist (e.g. connection failure, SQL error).","commonSituations":"Wisp table exists but is corrupt or locked; database connectivity problems; unexpected schema drift between versions where the table exists but columns differ.","solutions":["Inspect the wrapped error; TableNotExist is intentionally filtered out so this is a genuine failure","Verify wisps table schema matches the expected version","Check DB connectivity and retry","If the deployment should not have wisps, investigate why the table exists but fails"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// no pre-call validation available; ensure the deployment has a consistent wisps table state","typeGuard":null,"tryCatchPattern":"out, err := u.GetForIssueIDs(ctx, ids)\nif err != nil {\n\t// TableNotExist is already tolerated; anything here is a real failure\n\tlog.Errorf(\"wisp dep lookup failed: %v\", err)\n\treturn err\n}","preventionTips":["Do not create/copy a wisps table manually with mismatched schema","Keep beads and its migrations version-aligned","If wisps are unused, investigate unexpected wisps-table errors rather than ignoring them","Monitor DB health; this error usually means connectivity, not missing data"],"tags":["storage","dependency","wisps","wrapped-error"],"backgroundTag":"dependency-query-failed","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}