Skip to content

Fix quota trajectory billing period calculation - #325895

Merged
Paul (pwang347) merged 4 commits into
microsoft:mainfrom
rfeltis:rfeltis/quota-trajectory-calendar-month
Jul 15, 2026
Merged

Paul (pwang347) merged 4 commits into
microsoft:mainfrom
rfeltis:rfeltis/quota-trajectory-calendar-month

Conversation

@rfeltis

@rfeltis Ralph Feltis (rfeltis) commented Jul 15, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • compute quota trajectory elapsed days from one calendar month before the reset date
  • clamp month-end reset dates to the last valid day of the previous month
  • add deterministic 31-day billing-cycle coverage

Validation

  • npm run typecheck-client
  • quota trajectory tests: 13 passing in Chromium, WebKit, and Firefox

Follow-up to #320683.

Compute elapsed usage from one calendar month before the reset date instead of assuming every billing period is 30 days.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: aa202495-3a47-4b52-896f-3862c69efd9e
Copilot AI review requested due to automatic review settings July 15, 2026 02:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Corrects quota trajectory calculations to use the prior calendar month rather than a fixed 30-day period.

Changes:

  • Derives and clamps the billing-period start from the reset date.
  • Adds deterministic 31-day-cycle coverage.
Show a summary per file
File Description
chatQuotaNotification.ts Updates billing-period calculation.
chatQuotaNotification.test.ts Stabilizes time and covers a 31-day cycle.

Review details

  • Files reviewed: 2/2 changed files
  • Comments generated: 1
  • Review effort level: Medium
Cover March 31 resets in non-leap and leap years so the previous-month day clamp is exercised.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: aa202495-3a47-4b52-896f-3862c69efd9e
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: aa202495-3a47-4b52-896f-3862c69efd9e
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: aa202495-3a47-4b52-896f-3862c69efd9e
@rfeltis
Ralph Feltis (rfeltis) marked this pull request as ready for review July 15, 2026 17:42
@pwang347
Paul (pwang347) enabled auto-merge (squash) July 15, 2026 18:09
@pwang347
Paul (pwang347) merged commit 18b7325 into microsoft:main Jul 15, 2026
29 checks passed
@vs-code-engineering vs-code-engineering Bot added this to the 1.130.0 milestone Jul 15, 2026
Paul (pwang347) pushed a commit that referenced this pull request Aug 19, 2026
* Revert chat quota trajectory nudge

Remove the Chat Quota Trajectory Nudge after shipping control by
stopping the Public and Insiders ExP stages. This drops the feature
from #320683 and the billing-period fix from #325895.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* Remove unused ChatInputNotificationSeverity import

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@vs-code-engineering vs-code-engineering Bot locked and limited conversation to collaborators Aug 29, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

5 participants