Skip to content

Bump JasperFx to 2.28.0; declare EventProjection doc types for rebuild teardown (#4685 COPY)#4969

Merged
jeremydmiller merged 1 commit into
masterfrom
fix/4685-copy-rebuild-2.28-compat
Jul 17, 2026
Merged

Bump JasperFx to 2.28.0; declare EventProjection doc types for rebuild teardown (#4685 COPY)#4969
jeremydmiller merged 1 commit into
masterfrom
fix/4685-copy-rebuild-2.28-compat

Conversation

@jeremydmiller

Copy link
Copy Markdown
Member

Lands the JasperFx 2.27.0 → 2.28.0 bump and fixes a pre-existing binary-COPY rebuild bug that 2.28.0 unmasks.

What 2.28.0 brings

The pre-existing bug #522 surfaced

rebuild_with_bulk_copy_inserts (the #4685 binary-COPY rebuild tests) began failing with 23505 duplicate key. Root cause, confirmed with a direct detector run at V2.27.0, #480, and 2.28.0 (the collision fires at all three — 2.27.0 just swallowed the fault, so the test passed falsely):

An EventProjection writes documents via ad-hoc ops.Insert/ops.Store, so Marten cannot infer which document types it produces and never wiped them on rebuild. The per-row path tolerated stale docs (re-insert upserts), but the INSERT-only binary COPY rebuild assumes a truncated table and collides. This is a long-standing EventProjection limitation, not a regression, and (per maintainer direction) not something we change — an EventProjection must declare the types it writes.

Fix

  • The affected test projections declare their written type: Options.DeleteViewTypeOnTeardown<BulkCopyDoc>(), so the rebuild TRUNCATEs it first.
  • docs/events/projections/event-projections.md documents the requirement (and that INSERT-only COPY rebuilds require it).

Verified: all 9 rebuild_with_bulk_copy_inserts tests pass against the published JasperFx.Events 2.28.0 (net10.0).

🤖 Generated with Claude Code

…ld teardown

Bumps the four JasperFx packages 2.27.0 -> 2.28.0. Beyond the #524 defense-in-depth
(HighWaterAgent guards IDaemonWakeup throws + the watchdog observes the real loop task) and the
opt-in #525 deferred rebuild writes (default off), 2.28.0 carries #522, which
stops TimeoutAfterAsync from swallowing a rebuild fault. That correctly surfaces a pre-existing
bug in the binary-COPY rebuild tests: an EventProjection that writes documents via ad-hoc
ops.Insert cannot have those types inferred, so Marten never wiped them on rebuild. The per-row
path tolerated that (re-insert upserts), but the INSERT-only COPY rebuild assumes a truncated
table and hit a 23505 duplicate key — a failure that was silently swallowed on 2.27.0.

This is a long-standing EventProjection limitation (Marten can't know a projection's ad-hoc
ops.Insert/Store types), not a regression. Fix: the affected test projections declare their
written type via Options.DeleteViewTypeOnTeardown<BulkCopyDoc>() so the rebuild TRUNCATEs it
first, and the EventProjection docs now document the requirement.

Verified: all 9 rebuild_with_bulk_copy_inserts tests pass against the published JasperFx.Events
2.28.0 (net10.0).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XKKBPsFJ83jd2o4hyGJnj6
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