refactor(pool): inline item close and must-delete session logic#2232
Conversation
Remove closeItemFunc and mustDeleteItemFunc hooks from internal pool configuration and call item.Close and xerrors.MustDeleteTableOrQuerySession directly, eliminating duplicated setup in table and query clients. Co-authored-by: Cursor <cursoragent@cursor.com>
summaryInferred base version: v3.144.3 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2232 +/- ##
==========================================
- Coverage 78.00% 77.88% -0.13%
==========================================
Files 453 453
Lines 46204 46189 -15
==========================================
- Hits 36042 35972 -70
- Misses 8081 8127 +46
- Partials 2081 2090 +9
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
AI Review SummaryVerdict: ✅ No critical issues found Critical issuesNo critical issues found. Other findings
Detailed analysis: The refactoring is behaviorally equivalent for all production callers:
No remaining references to the removed API ( This review was generated automatically. Critical issues require attention; other findings are advisory. |
|
Analysis performed by claude, claude-opus-4-6. |
Drop the misleading gRPC context-cancellation remark from the onClose factory comment; testItem.Close does not use the context. Co-authored-by: Cursor <cursoragent@cursor.com>
Summary
closeItemFuncandmustDeleteItemFunchooks frominternal/poolconfiguration.item.Closedirectly when closing pool items and usexerrors.MustDeleteTableOrQuerySessionincheckItemAndError.WithMustDeleteItemFuncsetup from table/query clients and update pool tests to useBAD_SESSIONerrors instead of custom predicates.Test plan
go test ./internal/pool/ -count=1go test ./internal/table/ -count=1go test ./internal/query/ -count=1golangci-lint run ./internal/pool/ ./internal/table/ ./internal/query/Made with Cursor