[Bug] fixes SQS timeout#3919
Conversation
PR Review: Fix SQS Timeout IssueSummaryThis PR fixes a critical bug where TimeSpan.Seconds was incorrectly used instead of TimeSpan.TotalSeconds when setting SQS wait times and visibility timeouts. This caused failures for any timeout values >= 60 seconds. Positive Aspects1. Correct Fix
2. Comprehensive Coverage 3. Consistent Implementation Concerns and Recommendations1. Missing Test Coverage for the Bug Recommendation: Add a test case that configures a subscription with requeueDelay: TimeSpan.FromMinutes(5) or TimeSpan.FromSeconds(90), verifies the message doesn't reappear immediately, and confirms the delay is respected correctly. 2. Potential Integer Overflow 3. Code Style - Minor SecurityNo security concerns identified. The fix doesn't introduce vulnerabilities. PerformanceNo performance impact. The change from .Seconds to .TotalSeconds with Convert.ToInt32() is negligible. SummaryApprove with recommendations:
The core fix is solid and can be merged, but adding the test coverage would significantly improve confidence and prevent future regressions of this bug. |
There was a problem hiding this comment.
Gates Passed
4 Quality Gates Passed
See analysis details in CodeScene
Quality Gate Profile: Clean Code Collective
Want more control? Customize Code Health rules or catch issues early with our IDE extension and CLI tool.
Code ReviewSummaryThis PR fixes a critical bug where ✅ Positive Aspects
🔍 Code Quality ObservationsPositive:
Minor Note:
|
| Configuration | Expected | Actual (Bug) |
|---|---|---|
| 30 seconds | 30s | 30s ✅ |
| 60 seconds | 60s | 0s ❌ |
| 90 seconds | 90s | 30s ❌ |
| 5 minutes | 300s | 0s ❌ |
After Fix:
All values now correctly use total seconds.
✅ Recommendation
APPROVE with suggestion: The fix is correct and addresses the critical bug. However, I recommend adding test coverage for delays ≥ 60 seconds to prevent regression.
Next Steps
Consider adding a regression test in a follow-up PR that:
- Tests
ReceiveAsyncwithtimeOut ≥ 60 seconds - Tests
RequeueAsyncwithdelay ≥ 60 seconds
This would align with the project's testing guidelines which state: "Ensure all new features and bug fixes include appropriate test coverage."
Co-authored-by: Ian Cooper <ian_hammond_cooper@yahoo.co.uk>
Fixes #3917 SQS WaitTime/ChangeVisibilityTimeout