Skip to content

fix: set account/usage/get default start date#685

Merged
BravoNatalie merged 1 commit intomainfrom
fix/acount-usage-get
Mar 12, 2026
Merged

fix: set account/usage/get default start date#685
BravoNatalie merged 1 commit intomainfrom
fix/acount-usage-get

Conversation

@BravoNatalie
Copy link
Copy Markdown
Contributor

Issue

Currently, the Console usage report calls account/usage/get with the default parameters to get usage for the current month. However, the implementation sets the default start date to the previous month, which ends up making the usage report scan two months of data just to reconstruct the current size of a space.

Solution

This PR changes the default start date to the beginning of the current month.

@BravoNatalie BravoNatalie requested a review from fforbeck March 12, 2026 15:49
@BravoNatalie BravoNatalie requested a review from alanshaw as a code owner March 12, 2026 15:49
capability.nb.period?.from !== undefined
? new Date(capability.nb.period.from * 1000)
: startOfLastMonth(now)
: startOfMonth(now)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Good catch. Same issue we had in the egress report query.

@BravoNatalie BravoNatalie force-pushed the fix/acount-usage-get branch from 5d6566a to 8c5772c Compare March 12, 2026 16:10
@BravoNatalie BravoNatalie merged commit aac6fef into main Mar 12, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants