Fix #4730 — bump JasperFx to 2.9.10 (aggregate-cache double-apply) + regression test#4731
Merged
Merged
Conversation
…regression test 2.9.10 carries #444: the async aggregate cache is OFF by default again (CacheLimitPerTenant 1000 → 0) and, when enabled, only populates after the owning batch commits. Previously the cache was written during batch build before commit, so a failed/retried batch (e.g. an out-of-order Update-before-Create stream throwing ApplyEventException → skip-and-rebuild) re-applied events on top of the already- mutated cached aggregate, double-applying to unrelated, correctly-ordered streams in the same page. Bug_4730 is a theory over CacheLimitPerTenant 0 (default) and 1000 (cache on), so it guards both halves of the fix: the control stream's Update must be applied exactly once even though a sibling stream throws. Verified green against 2.9.10 (both cases). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This was referenced Jun 15, 2026
Merged
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.
Closes #4730. Consumes the upstream fix (jasperfx#444, shipped in JasperFx 2.9.10).
The bug
An async aggregate projection double-applied a correctly-ordered "control" stream's event when an unrelated stream in the same page threw during apply (an out-of-order Update-before-Create). Reproduced cleanly: the control stream's value came out 2× expected. Worked in 9.6, broke in 9.7.
Root cause (fixed upstream)
The in-memory aggregate cache was turned on by default in JasperFx 2.9.0 and isn't transactional —
AggregationRunnerwrote the mutated aggregate to the cache during batch build, before commit. When the poison event triggeredbuildBatchWithSkippingto skip-and-rebuild, the rebuild read the already-mutated control aggregate back from the cache and applied its events again.What 2.9.10 changes
CacheLimitPerTenantdefaults back to 0 (cache off / opt-in), restoring pre-2.9.0 behavior.This PR
JasperFx.*packages 2.9.9 → 2.9.10 inDirectory.Packages.props.Bug_4730_double_apply_with_out_of_order_stream, a theory overCacheLimitPerTenant0 and 1000 so it permanently guards both halves of the fix (default-off and populate-on-commit): the control stream's Update must be applied exactly once even though a sibling stream throws.Verification
Bug_4730— 2/2 green against the published 2.9.10 (cache off and cache on). The same test fails on 2.9.9.Bug_4730,Bug_4428) — green.🤖 Generated with Claude Code