Skip to content

Pin JasperFx 1.35.0 cache fix to the TeleHealth scenario (#4329)#4340

Merged
jeremydmiller merged 1 commit intomasterfrom
4329-followup-additional-coverage
May 7, 2026
Merged

Pin JasperFx 1.35.0 cache fix to the TeleHealth scenario (#4329)#4340
jeremydmiller merged 1 commit intomasterfrom
4329-followup-additional-coverage

Conversation

@jeremydmiller
Copy link
Copy Markdown
Member

Summary

Followup coverage for #4329.

multi_stage_projections.end_to_end already covers the composite projection happy path under default cache sizes. This PR adds a focused regression test against the exact reproduction Jeremy diagnosed in the issue:

with CacheLimitPerTenant = 1 on AppointmentProjection, every AppointmentByExternalIdentifier slice's EnrichWith<Appointment>.AddReferences lookup falls through to a SQL load that can't see the upstream's queued in-flight writes, so the downstream document never materialises.

JasperFx.Events 1.35.0 (jasperfx#206) keeps the upstream cache at full size for the duration of the composite batch, which fixes this. Marten #4338 added a small synthetic Bug_4329_fan_out_and_cache_limit test for the cache fix; this PR adds the matching regression at the original real-world scenario, so a future change that re-introduces mid-composite compaction would fail loudly here, not just on the smaller synthetic test.

What changes

  • New [Fact] downstream_lookups_survive_tiny_upstream_cache in multi_stage_projections.cs.
  • Builds the same TeleHealth composite as end_to_end, but registers AppointmentProjection as an instance with Options.CacheLimitPerTenant = 1 instead of the type-only Add<AppointmentProjection>().
  • Asserts that both Appointment and AppointmentByExternalIdentifier have rows after the daemon catches up — the latter being the canary that previously hit zero under the cache eviction bug.

Test plan

  • downstream_lookups_survive_tiny_upstream_cache passes on net10.0 (3s).
  • All 9 DaemonTests/Composites/* tests pass on net10.0 with the new test added (the existing 8 plus the new regression).

🤖 Generated with Claude Code

…nosis

multi_stage_projections.cs already covers the composite projection happy path
under default cache sizes. Add a focused regression test that boots the same
TeleHealth setup but forces AppointmentProjection.CacheLimitPerTenant = 1 —
the exact reproduction Jeremy diagnosed in his first followup comment on
GH-4329, where AppointmentByExternalIdentifierProjection's
EnrichWith<Appointment>().AddReferences() lookups would silently fall through
to a SQL load that couldn't see in-flight upstream writes and produce zero
downstream documents.

JasperFx.Events 1.35.0 (PR #206) keeps the upstream cache at full
size for the duration of the composite batch, fixing this. The new
downstream_lookups_survive_tiny_upstream_cache test pins that fix at the
TeleHealth scenario so a future change that re-introduces mid-composite
compaction would fail loudly here, not just on the smaller fan-out test.

Refs #4329.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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