Remove maxKeys limit feature from NodeCacheStore#1605
Conversation
BREAKING CHANGE: Remove maxKeys option from NodeCacheStore as it does not make sense for a store backed by external services (Redis, MongoDB, etc.) where the backend manages its own capacity. The maxKeys option remains available on the in-memory NodeCache class. Bumps @cacheable/node-cache to v3.0.0. https://claude.ai/code/session_01SY98RRSBdLQBanZEsGmqv4
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request streamlines the Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request removes the maxKeys functionality from the NodeCacheStore and updates the package version to 3.0.0. While the removal of maxKeys is aligned with the PR's goal, the internal statistics tracking (_stats object) remains, but without a public API to access the collected data. It is suggested to add a getStats() method to expose this information and make the stats feature fully functional.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1605 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 26 26
Lines 2473 2438 -35
Branches 558 547 -11
=========================================
- Hits 2473 2438 -35 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Please check if the PR fulfills these requirements
What kind of change does this PR introduce?
Breaking Change - Feature Removal
Description
This PR removes the
maxKeyslimit feature from the NodeCacheStore class. The feature allowed users to set a maximum number of keys that could be stored in the cache, returningfalsewhen attempting to exceed this limit.Changes Made
maxKeysoption fromNodeCacheStoreOptionstype_maxKeysprivate field fromNodeCacheStoreclassmaxKeysgetter and setter methodsset()methodRationale
The maxKeys feature added unnecessary complexity to the caching logic and is not commonly used. Removing it simplifies the codebase and reduces maintenance burden. Users requiring key limits can implement this logic at the application level if needed.
Test Plan
Existing unit tests have been updated to remove maxKeys-specific test cases. All remaining tests pass and cover the core caching functionality (set, get, ttl, clear, etc.).
https://claude.ai/code/session_01SY98RRSBdLQBanZEsGmqv4