Skip to content

Fix weakMapMemoize maxSize counting argument nodes instead of results - #830

Closed
Narek-Khachikyan wants to merge 1 commit into
reduxjs:masterfrom
Narek-Khachikyan:fix/weakmap-maxsize-results
Closed

Narek-Khachikyan wants to merge 1 commit into
reduxjs:masterfrom
Narek-Khachikyan:fix/weakmap-maxsize-results

Conversation

@Narek-Khachikyan

Copy link
Copy Markdown

Summary

weakMapMemoize counts new primitive argument nodes toward maxSize, so cycling two argument pairs with maxSize: 2 computes six times.

- Count new primitive argument nodes.
+ Count each cached or promoted result once.

Fixes #829.

Evidence

Proof: all four new regressions fail before the fix and pass after it, with two pairs computing twice. pnpm test passes 141 runtime and 29 type tests; lint, formatting, package build, and package type validation pass.

Merge danger

Two-way door. The change affects generation accounting when maxSize is set.

@netlify

netlify Bot commented Nov 8, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for reselect-docs canceled.

Name Link
🔨 Latest commit 4b342ce
🔍 Latest deploy log https://app.netlify.com/projects/reselect-docs/deploys/6af015b247c474b21ed69642

@Narek-Khachikyan Narek-Khachikyan closed this by deleting the head repository Nov 9, 2026
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.

weakMapMemoize maxSize counts primitive arguments, not results, so multi-argument caches never hit

1 participant