Skip to content

Conversation

@ireneea
Copy link
Contributor

@ireneea ireneea commented Oct 31, 2025

Summary

  • Fix default 'last 7 days' default range
  • Fix the number of days of the previous period

Related Linear tickets, Github issues, and Community forum posts

fixes PAY-4052

Review / Merge checklist

  • PR title and summary are descriptive. (conventions)
  • Docs updated or follow-up ticket created.
  • Tests included.
  • PR Labeled with release/backport (if the PR is an urgent fix that needs to be backported)

@codecov
Copy link

codecov bot commented Oct 31, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@n8n-assistant n8n-assistant bot added core Enhancement outside /nodes-base and /editor-ui n8n team Authored by the n8n team labels Oct 31, 2025
@blacksmith-sh

This comment has been minimized.

@ireneea ireneea marked this pull request as ready for review October 31, 2025 07:43
Copy link
Contributor Author

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;
Copy link
Contributor Author

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 😅

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a 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

Copy link
Contributor

@guillaumejacquart guillaumejacquart left a 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(),
Copy link
Contributor

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

@currents-bot
Copy link

currents-bot bot commented Nov 3, 2025

E2E Tests: n8n tests timed out after 30m

🟢 83 · 🔴 0 · ⚪️ 2 · 🟣 1

View Run Details

Run Details

  • Project: n8n

  • Groups: 2

  • Framework: Playwright

  • Run Status: Timed out

  • Commit: b9d3099

  • Spec files: 96

  • Overall tests: 596

  • Duration: 30m

  • Parallelization: 1

Groups

GroupId Results Spec Files Progress
ui 🟢 83 · 🔴 0 · ⚪️ 2 · 🟣 1 9 / 89
ui:isolated 🟢 0 · 🔴 0 · ⚪️ 0 0 / 7


This message was posted automatically by currents.dev | Integration Settings

@ireneea ireneea merged commit 1a70592 into master Nov 3, 2025
45 of 47 checks passed
@ireneea ireneea deleted the pay-4052-insights-query-date-range-calculation-is-incorrect branch November 3, 2025 10:38
@github-actions github-actions bot mentioned this pull request Nov 3, 2025
@n8n-assistant
Copy link

n8n-assistant bot commented Nov 3, 2025

Got released with [email protected]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Enhancement outside /nodes-base and /editor-ui n8n team Authored by the n8n team Released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants