Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect default value of maxEntries for MemoryCache #904

Closed
IvanPenga opened this issue Nov 4, 2024 · 2 comments
Closed

Incorrect default value of maxEntries for MemoryCache #904

IvanPenga opened this issue Nov 4, 2024 · 2 comments

Comments

@IvanPenga
Copy link

Added in opossum version 8.2.0, if cacheSize property is not provided to MemoryCache constructor, it will default to 2 ^ 24 - 1, which is 21, because caret (^) operator is bitwise operator, not exponentiation operator. This should be replaced with ** operator, or Math.pow function.

@daan944
Copy link
Contributor

daan944 commented Nov 8, 2024

That's my bad, sorry. Fixed it in PR

lholmquist pushed a commit that referenced this issue Nov 11, 2024
* Fixed: Incorrect default value of maxEntries for MemoryCache #904

* Added: more test coverage for internal cache
Fixed: do not remove items from cache upon updating existing key.

---------

Co-authored-by: Daan <>
@lholmquist
Copy link
Member

fix is in the newly released 8.3.1

daan944 pushed a commit to daan944/opossum that referenced this issue Nov 20, 2024
* main:
  chore(main): release 8.3.1 (nodeshift#907)
  fix: Incorrect default value of maxEntries for MemoryCache nodeshift#904 (nodeshift#906)

# Conflicts:
#	lib/cache.js
daan944 pushed a commit to daan944/opossum that referenced this issue Nov 20, 2024
Merge branch 'main' into coalesce-reset-options

* main:
  chore(main): release 8.3.1 (nodeshift#907)
  fix: Incorrect default value of maxEntries for MemoryCache nodeshift#904 (nodeshift#906)

# Conflicts:
#	lib/cache.js
lholmquist pushed a commit that referenced this issue Nov 27, 2024
… success, timeout) (#908)

* Feature: option to reset coalesce depending on result of action.

* Fix: Don't crash when coalescing is disabled.

* Bugfix: Fix max size for cache entries.

* Fixed error whilst merging, accidentally removed cache delete function

Merge branch 'main' into coalesce-reset-options

* main:
  chore(main): release 8.3.1 (#907)
  fix: Incorrect default value of maxEntries for MemoryCache #904 (#906)

# Conflicts:
#	lib/cache.js

* Docs: Update readme with coalesceResetOn and Fetch example.

---------

Co-authored-by: Daan <>
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

No branches or pull requests

3 participants