Skip to content

Conversation

@amit13k
Copy link
Contributor

@amit13k amit13k commented Aug 24, 2025

Please check if the PR fulfills these requirements

  • Followed the Contributing guidelines.
  • Tests for the changes have been added (for bug fixes/features) with 100% code coverage.
  • Docs have been added / updated (for bug fixes / features)

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
Bug fix - pass createKey option through wrap methods

The createKey option was not being passed from wrap() methods to the underlying wrapSync/wrap functions, preventing custom cache key generation from working.

Fixed in:

  • @cacheable/cacheable: CacheableMemory.wrap() and Cacheable.wrap()
  • @cacheable/memory: CacheableMemory.wrap()

  The createKey option was not being passed from wrap() methods to the
  underlying wrapSync/wrap functions, preventing custom cache key
  generation as documented.

  Fixed in:
  - @cacheable/cacheable: CacheableMemory.wrap() and Cacheable.wrap()
  - @cacheable/memory: CacheableMemory.wrap()

  Added tests to verify the fix works correctly.
@codecov
Copy link

codecov bot commented Aug 24, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (7cea5d7) to head (cc4cf1e).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #1269   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           35        35           
  Lines         4183      4186    +3     
  Branches      1246      1227   -19     
=========================================
+ Hits          4183      4186    +3     

☔ 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.

@jaredwray
Copy link
Owner

@amit13k - thanks for adding this. Would you also be willing to update @cacheable/memoize as we will be moving to that shortly.

@amit13k
Copy link
Contributor Author

amit13k commented Aug 24, 2025

@jaredwray Thanks for the awesome library! I hit that createKey bug and attempted to fix it, but honestly I'm not familiar enough with the memoize package to confidently make changes there right now.

@jaredwray
Copy link
Owner

@amit13k - ok. It is pretty much the same code as what we have in cacheable.wrap as we are going to move to it in the next 2-3 weeks. I can make the change.

@jaredwray
Copy link
Owner

@amit13k - this should get released in the next week or so.

@jaredwray jaredwray merged commit 7a44ed1 into jaredwray:main Aug 24, 2025
5 checks 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