-
Notifications
You must be signed in to change notification settings - Fork 320
fix: long timeranges for task queries truncated #1276
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
🦋 Changeset detectedLatest commit: bf97eea The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
PR Review
Overall Assessment: Good fix for preventing ClickHouse query timeouts
Code Quality Issues:
-
Logging inaccuracy in util.ts:79 - numWindows value in second log message is stale (calculated before first truncation). Consider recalculating or removing from second log.
-
Minor: Variable oneDayMs in tests (line 344) is defined but never used - Remove unused variable.
Positive Notes:
- Comprehensive test coverage (10 test cases)
- Clear documentation in changeset
- Proper error prevention logic
- Good use of logging for observability
Recommendation: Address the logging accuracy issue before merge to avoid confusion during debugging.
E2E Test Results✅ All tests passed • 25 passed • 3 skipped • 225s
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 with one minor nitpick
@claude remove the unused variable that the reviewer Dan mentioned
Code Review
✅ No critical issues found.
The implementation looks solid:
- ✅ Good test coverage with 11 comprehensive test cases
- ✅ Proper handling of edge cases (zero time range, fractional windows, exact limits)
- ✅ Clear logging added for debugging truncation behavior
- ✅ Constants well-defined (MAX_NUM_WINDOWS, maxLookbackTime)
- ✅ Logic correctly applies the more restrictive limit when both are exceeded
Minor observations (non-blocking):
- The magic numbers (50, 6, 24) are now constants but could benefit from comments explaining the rationale
- Consider adding JSDoc to
calcAlertDateRangeto document the truncation behavior for future maintainers
Co-authored-by: Aaron Knudtson <knudtty@users.noreply.github.com>
Uh oh!
There was an error while loading. Please reload this page.
Fixes HDX-2618
Related to https://github.com/ClickHouse/support-escalation/issues/6113