Skip to content

#4966: Natural key is not updated when rebuilding a projection#4967

Closed
ytqsl wants to merge 1 commit into
JasperFx:masterfrom
ytqsl:bugs/4966
Closed

#4966: Natural key is not updated when rebuilding a projection#4967
ytqsl wants to merge 1 commit into
JasperFx:masterfrom
ytqsl:bugs/4966

Conversation

@ytqsl

@ytqsl ytqsl commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@jeremydmiller

Copy link
Copy Markdown
Member

Thanks for the clear reproduction, @ytqsl! Superseded by #4970, which retains your test (with you as co-author), bumps to JasperFx 2.28.1 carrying the actual fix (JasperFx/jasperfx#528), and closes #4966.

Root cause: natural-key discovery silently skipped a two-arg static evolve method (static TDoc Apply(TEvent e, TDoc current)), so the update event produced no natural-key mapping and the changed key was never written to mt_natural_key_X. Your repro fails on 2.28.0 and passes on 2.28.1.

jeremydmiller added a commit that referenced this pull request Jul 17, 2026
…8.1 (#4970)

A natural key that CHANGES via an update event was never written to the
mt_natural_key_X lookup table — only the create event's key was recorded — so
FetchLatest-by-natural-key could not find the stream under its new key after a
rebuild (or live inline append). Root cause and fix are in JasperFx: natural-key
discovery silently skipped a two-arg static evolve method
(static TDoc Apply(TEvent e, TDoc current)), so no mapping was built for the
update event (#528). This bumps the JasperFx packages to 2.28.1 to pick
up that fix.

Includes the original reproduction test from #4967 (thanks @ytqsl); it fails on
2.28.0 ("should not be null but was") and passes on 2.28.1.

Supersedes #4967.
Closes #4966.



Claude-Session: https://claude.ai/code/session_01XKKBPsFJ83jd2o4hyGJnj6

Co-authored-by: Yossi Tamari <yossi.tamari@gov.ab.ca>
Co-authored-by: Claude Opus 4.8 (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.

2 participants