Skip to content

Preserve replacement cache entries after stale rejection - #51

Open
feritcemkahraman wants to merge 1 commit into
github:mainfrom
feritcemkahraman:fix-stale-promise-cache-eviction
Open

feritcemkahraman wants to merge 1 commit into
github:mainfrom
feritcemkahraman:fix-stale-promise-cache-eviction

Conversation

@feritcemkahraman

Copy link
Copy Markdown

If a pending request is evicted and the same key is recomputed, rejection of the old request currently deletes the replacement cache entry. The next caller starts another request instead of sharing the replacement.

Only evict a rejected promise if it is still the cached value for that key.

The new regression failed before the fix; all 12 Vitest tests, TypeScript checks and ESM/CJS compilation pass. ESLint passes with generated dist excluded (the repository's flat config otherwise lints build output).

@feritcemkahraman
feritcemkahraman requested a review from a team as a code owner October 20, 2026 11:39
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