Repository navigation
fix: preserve replacement cache entries after batch failure - #404
Open
Claire-ovo wants to merge 1 commit into
Open
Claire-ovo wants to merge 1 commit into
Claire-ovo wants to merge 1 commit into
Conversation
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #403.
If a key is cleared and reloaded or primed while an earlier batch is pending, that batch's failure currently evicts the replacement entry. Track each queued request's promise and only clear the cache when it still contains that promise. The original rejection, normal failed-request eviction, and per-item error caching are preserved.
Adds 17 deterministic regression/control cases for pending, completed and primed replacements, normalized keys, custom cache maps, batching on/off, repeated keys across batches, disabled caching and synchronous batch exceptions. Against the original source, 14 fail and 3 pass; with this fix, the full 76-test suite passes on Node 18, 20 and 22.
npm run test:ci -- --runInBandpasses on Node 22 (lint, Flow, and 100% statement/branch/function/line coverage), as do the build and a built-output reproduction.Includes a patch changeset. This changes observable cache behavior after failure; happy to adjust the release classification if needed. Related Python-port fix: syrusakbary/aiodataloader#60.