Conversation
|
Claude finished @thomhurst's task —— View job PR Review AnalysisReviewing this PR that fixes hooks not properly awaiting in generic classes. Todo List:
Review SummaryThis PR fixes a critical bug where hooks in generic classes weren't properly awaiting async operations. The fix involves two main changes: ✅ Code Quality & Best PracticesTUnit.Core.SourceGenerator/Generators/HookMetadataGenerator.cs:627
TUnit.Core/AsyncConvert.cs
✅ Bug Fix AnalysisThe root issue was in how the source generator was wrapping method invocation results: // Before (problematic)
await AsyncConvert.ConvertObject(() => result);
// After (correct)
await AsyncConvert.ConvertObject(result);The lambda wrapper was preventing proper detection of async return types, especially problematic for generic classes where reflection is used. ✅ Test CoverageExcellent test coverage with two comprehensive test files:
✅ Performance Considerations
✅ Security Concerns
✅ Specific Code ReviewAsyncConvert.cs changes are well-designed:
Source generator changes are minimal and correct:
🔍 Minor Observations
Verdict✅ APPROVE - This is a well-crafted fix that:
The changes demonstrate good understanding of the async conversion pipeline and provide a clean solution to the generic class hook awaiting issue. |
Fixes #2935