refactor(pool): inline item close and must-delete session logic#2232
refactor(pool): inline item close and must-delete session logic#2232kprokopenko wants to merge 2 commits into
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.143.0 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2232 +/- ##
==========================================
- Coverage 75.40% 75.32% -0.09%
==========================================
Files 445 445
Lines 45996 45981 -15
==========================================
- Hits 34684 34635 -49
- Misses 9352 9385 +33
- Partials 1960 1961 +1
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