-
Notifications
You must be signed in to change notification settings - Fork 51.1k
fix: Fix insights query date range calculation in backend #21409
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
fix: Fix insights query date range calculation in backend #21409
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This comment has been minimized.
This comment has been minimized.
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.
Started to move the Insights service logic tests in here so that the integration test could be simplified but only got time to do it for the getInsightsSummary
| } else { | ||
| // Calculate the date range (minimum 1 day) for previous period | ||
| const dateRangeInDays = Math.max(1, daysDiff); | ||
| const dateRangeInDays = daysDiff + 1; |
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.
This was actually compensating for the mistake done with the default date but then it broke the other requests 😅
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.
No issues found across 6 files
…tion-is-incorrect
…tion-is-incorrect
guillaumejacquart
left a comment
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.
Numbers are good now on my side
| if (!query.startDate) { | ||
| return { | ||
| startDate: DateTime.now().minus({ days: 7 }).toJSDate(), | ||
| startDate: DateTime.now().minus({ days: 6 }).toJSDate(), |
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.
Might just be worth adding a comment here to explain why we take 6 instead of 7 by default
|
E2E Tests: n8n tests timed out after 30m Run Details
Groups
This message was posted automatically by
currents.dev | Integration Settings
|
|
Got released with |
Summary
Related Linear tickets, Github issues, and Community forum posts
fixes PAY-4052
Review / Merge checklist
release/backport(if the PR is an urgent fix that needs to be backported)