Adopt JasperFx.Events 1.35.0: fan-out enrichment + composite cache fix (#4329)#4338
Merged
jeremydmiller merged 1 commit intomasterfrom May 7, 2026
Merged
Conversation
JasperFx.Events 1.35.0 ships two changes that close out the usability gap @xander-abn surfaced in #4329: 1. Composite-projection cache eviction fix (JasperFx/jasperfx#206) — AppointmentByExternalIdentifier (and similar EnrichWith<UpstreamDoc> chains) no longer drop downstream lookups when the upstream's CacheLimitPerTenant is small relative to per-batch fan-out. 2. ForEntityIds (JasperFx/jasperfx#208) — first-class declarative shape for 1-event-to-N-entities enrichment. This commit: - Bumps JasperFx.Events 1.34.0 → 1.35.0 in Directory.Packages.props. - Adds Bug_4329_fan_out_and_cache_limit with two facts: a fan-out scenario using ForEntityIds (one OrderPlacedWithLineItems event referencing 5 upstream Product documents), and a cache-eviction regression that intentionally sets ProductProjection.CacheLimitPerTenant = 1 and verifies 20 distinct upstream lookups all resolve to the in-flight cache. - Wires the new patterns into composite.md and enrichment.md, removes the now-stale "cache-limit is load-bearing for correctness" caveat, and adds a "Fan-out enrichment with ForEntityIds" section sourced from #region sample_for_entity_ids_fan_out in the new test. Refs #4329, JasperFx/jasperfx#206, JasperFx/jasperfx#208. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This was referenced May 7, 2026
This was referenced May 7, 2026
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.
Summary
Closes out the followup ask in #4329. Two JasperFx.Events 1.35.0 changes flow into Marten via this PR, plus a Marten-side integration test and the docs that go with them.
Two upstream fixes pulled in via the package bump
Composite-projection cache eviction fix (JasperFx/jasperfx#206) — per-projection caches are no longer compacted between stages of a composite. Earlier, with a small `CacheLimitPerTenant`, end-of-stage-1 compaction evicted entities that downstream stages were about to look up via `EnrichWith().AddReferences()` or `TryFindUpstreamCache<TId, T>`. Evicted ids fell through to `storage.LoadManyAsync`, which can't see the upstream's queued in-flight writes — silently dropping them. `CacheLimitPerTenant` is now a memory tunable again, not a correctness lever for downstream lookups.
`ForEntityIds` for fan-out enrichment (JasperFx/jasperfx#208) — a first-class declarative variant of `ForEntityId` for events that reference several entities of the same type, e.g. `OrderPlacedWithLineItems` carrying a list of `ProductId`s. Each resolved id materializes as one `References` synthetic event, so `Evolve` reads them through the same case arm as the 1-to-1 case.
Marten-side changes in this PR
Test plan
Polecat parity
Tracked in JasperFx/polecat#41. Polecat's composite projection support is built on the same JasperFx.Events foundations, so it inherits both fixes once it bumps the package; the issue covers the bump, an integration test mirror, and the docs.
🤖 Generated with Claude Code