Skip to content

fix(site): use correct default insights time for day interval #10837

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

Merged
merged 2 commits into from
Nov 22, 2023

Conversation

mafredri
Copy link
Member

@mafredri mafredri commented Nov 22, 2023

API requests were being made without fixing the clock due to default values relying on new Date without truncating. E.g.

start_time: 2023-11-16T14:34:23+02:00
end_time: 2023-11-22T14:34:23+02:00
{
	"message": "Query parameter has invalid value.",
	"validations": [
		{
			"field": "start_time",
			"detail": "Query param \"start_time\" must have the clock set to 00:00:00"
		}
	]
}

This change fixes both start and end, and takes into account corner cases like day changing between two invocations of new Date().

@mafredri mafredri self-assigned this Nov 22, 2023
Copy link

@cdr-bot cdr-bot bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is a hotfix and has been automatically approved.

  • ✅ Base is main
  • ✅ Has hotfix label
  • ✅ Head is from coder/coder
  • ✅ Less than 100 lines

@mafredri mafredri changed the title fix(site): use correct insights start time when switching interavl to day fix(site): use correct insights start time when switching interval to day Nov 22, 2023
Copy link

github-actions bot commented Nov 22, 2023


🚀 Deploying PR 10837 ...

@mafredri mafredri force-pushed the mafredri/fix-site-insights-default-interval-for-day branch from 27781cb to 03b1fa5 Compare November 22, 2023 12:25
@mafredri mafredri changed the title fix(site): use correct insights start time when switching interval to day fix(site): use correct default insights time for day interval Nov 22, 2023
@mafredri mafredri enabled auto-merge (squash) November 22, 2023 12:26
@mtojek
Copy link
Member

mtojek commented Nov 22, 2023

Thanks for the contribution. Could you please add some description to the issue to motivate this change? I bet that we will re-explore this topic in a month :)

@mafredri mafredri merged commit a20ec66 into main Nov 22, 2023
@mafredri mafredri deleted the mafredri/fix-site-insights-default-interval-for-day branch November 22, 2023 12:30
@github-actions github-actions bot locked and limited conversation to collaborators Nov 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants