-
-
Notifications
You must be signed in to change notification settings - Fork 110
Fix hooks not properly awaiting in generic classes #2936
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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