Skip to content

keyv - feat: (breaking) by default keyv no longer checks expires#1923

Merged
jaredwray merged 16 commits intomainfrom
keyv---feat-(breaking)-by-default-keyv-no-longer-checks-expires
Mar 31, 2026
Merged

keyv - feat: (breaking) by default keyv no longer checks expires#1923
jaredwray merged 16 commits intomainfrom
keyv---feat-(breaking)-by-default-keyv-no-longer-checks-expires

Conversation

@jaredwray
Copy link
Copy Markdown
Owner

@jaredwray jaredwray commented Mar 30, 2026

Please check if the PR fulfills these requirements

  • Followed the Contributing and Code of Conduct guidelines.
  • Tests for the changes have been added (for bug fixes/features) with 100% code coverage.

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
keyv - feat: (breaking) by default keyv no longer checks expires

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 30, 2026

Codecov Report

❌ Patch coverage is 99.45355% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 99.94%. Comparing base (bca7d95) to head (30ea861).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
storage/memcache/src/index.ts 92.85% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##              main    #1923      +/-   ##
===========================================
- Coverage   100.00%   99.94%   -0.06%     
===========================================
  Files           40       40              
  Lines         3728     3974     +246     
  Branches       554      636      +82     
===========================================
+ Hits          3728     3972     +244     
- Misses           0        2       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a new checkExpired configuration option to Keyv, enabling optional expiry validation at the Keyv layer. To support this and improve consistency, multiple storage adapters (Memory, DynamoDB, Etcd, Memcache, MongoDB, MySQL, Postgres, and SQLite) have been updated to perform manual expiry checks and cleanup during read operations. Feedback focuses on optimizing performance by avoiding $O(N^2)$ lookups in batch operations, preventing potential Out-Of-Memory errors in MongoDB by using cursors instead of .toArray(), and reducing database overhead in SQL adapters by avoiding DELETE queries on every cache miss.

@jaredwray jaredwray merged commit fd5d40a into main Mar 31, 2026
10 of 12 checks passed
@jaredwray jaredwray deleted the keyv---feat-(breaking)-by-default-keyv-no-longer-checks-expires branch March 31, 2026 13:48
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.

1 participant