Skip to content

Conversation

@kaposke
Copy link
Contributor

@kaposke kaposke commented Dec 8, 2025

Ensure UsageTracker revalidates stale cache entries

Updates the UsageTracker read paths so that get and getAll proactively call revalidate when cache entries are missing or past their revalidateAfter timestamp. Adds integration tests covering the new revalidation triggers for both methods, including null, stale, and fresh cache scenarios.

Key Changes

• Invoke revalidate from UsageTracker.get when the cached entry is null or stale
• Invoke revalidate from UsageTracker.getAll under the same null/stale conditions per metric
• Extend usage.integration.test.ts with cases verifying revalidation behavior for get and getAll

Affected Areas

packages/account-usage/lib/usage.ts
packages/account-usage/lib/usage.integration.test.ts


This summary was automatically generated by @propel-code-bot

@kaposke kaposke requested a review from TBonnin December 8, 2025 19:27
@my-senior-dev-pr-review
Copy link

my-senior-dev-pr-review bot commented Dec 8, 2025

🤖 My Senior Dev — Analysis Complete

👤 For @kaposke

📁 Expert in packages/ (71 edits) • ⚡ 4th PR this month

View your contributor analytics →


📊 2 files reviewed • 3 need attention

⚠️ Needs Attention:

  • packages/account-usage/lib/usage.ts — Changes relate to data revalidation that could impact the integrity of usage tracking.

🚀 Open Interactive Review →

The full interface unlocks features not available in GitHub:

  • 💬 AI Chat — Ask questions on any file, get context-aware answers
  • 🔍 Smart Hovers — See symbol definitions and usage without leaving the diff
  • 📚 Code Archeology — Understand how files evolved over time (/archeology)
  • 🎯 Learning Insights — See how this PR compares to similar changes

💬 Chat here: @my-senior-dev explain this change — or try @chaos-monkey @security-auditor @optimizer @skeptic @junior-dev

📖 View all 12 personas & slash commands

You can interact with me by mentioning @my-senior-dev in any comment:

In PR comments or on any line of code:

  • Ask questions about the code or PR
  • Request explanations of specific changes
  • Get suggestions for improvements

Slash commands:

  • /help — Show all available commands
  • /archeology — See the history and evolution of changed files
  • /profile — Performance analysis and suggestions
  • /expertise — Find who knows this code best
  • /personas — List all available AI personas

AI Personas (mention to get their perspective):

Persona Focus
@chaos-monkey 🐵 Edge cases & failure scenarios
@skeptic 🤨 Challenge assumptions
@optimizer Performance & efficiency
@security-auditor 🔒 Security vulnerabilities
@accessibility-advocate Inclusive design
@junior-dev 🌱 Simple explanations
@tech-debt-collector 💳 Code quality & shortcuts
@ux-champion 🎨 User experience
@devops-engineer 🚀 Deployment & scaling
@documentation-nazi 📚 Documentation gaps
@legacy-whisperer 🏛️ Working with existing code
@test-driven-purist Testing & TDD

For the best experience, view this PR on myseniordev.com — includes AI chat, file annotations, and interactive reviews.

Copy link
Collaborator

@TBonnin TBonnin left a comment

Choose a reason for hiding this comment

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

can we add/modify tests to check the new behavior

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.

3 participants